i18n-ai-translate
Version:
AI-powered localization CLI, Node library, and GitHub Action. Translate i18next JSON, Gettext PO, Java .properties, and iOS .strings with ChatGPT, Claude, Gemini, or local Ollama models.
24 lines (23 loc) • 1.09 kB
TypeScript
import type TranslationContext from "../interfaces/translation_context";
/**
* Complete the initial translation of the input text.
* @param flatInput - The flatinput object containing the json to translate
* @param options - The options to generate the translation
* @param chats - The options to generate the translation
* @param translationStats - The translation statistics
*/
export default function translateCSV(ctx: TranslationContext): Promise<{
[key: string]: string;
}>;
/**
* Split a model's CSV translation response into one entry per line,
* dropping blank lines. The model often pads the response with a
* trailing newline or blank separator lines; a genuine CSV translation
* is always a quoted string, so an empty line is never valid output —
* only noise. Filtering it here keeps the downstream line-count check
* from rejecting (and ultimately dropping) the whole batch over a stray
* blank line. See Bug 6.
* @param text - the raw model response
* @returns the non-empty lines
*/
export declare function splitTranslationLines(text: string): string[];