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.
35 lines (34 loc) • 1.63 kB
TypeScript
import type { TranslateItemInput, VerifyItemInput } from "./types";
import type Glossary from "../interfaces/glossary";
import type OverridePrompt from "../interfaces/override_prompt";
/**
* Prompt an AI to convert a given input from one language to another
* @param inputLanguageCode - The ISO-639-1 code of the input
* @param outputLanguageCode - The ISO-639-1 code of the output
* @param translateItems - The input to be translated
* @param options - Optional prompt-shaping inputs: override, context, placeholder delimiters, key list for plural detection
* @returns A prompt for the AI to translate the input
*/
export declare function translationPromptJSON(inputLanguageCode: string, outputLanguageCode: string, translateItems: TranslateItemInput[], options?: {
overridePrompt?: OverridePrompt;
context?: string;
glossary?: Glossary;
templatedStringPrefix?: string;
templatedStringSuffix?: string;
keys?: string[];
}): string;
/**
* Prompt an AI to ensure a translation is valid
* @param inputLanguageCode - The ISO-639-1 code of the input
* @param outputLanguageCode - The ISO-639-1 code of the output
* @param verificationInput - The input to be translated
* @param options - Optional prompt-shaping inputs
* @returns A prompt for the AI to verify the translation
*/
export declare function verificationPromptJSON(inputLanguageCode: string, outputLanguageCode: string, verificationInput: VerifyItemInput[], options?: {
overridePrompt?: OverridePrompt;
context?: string;
glossary?: Glossary;
templatedStringPrefix?: string;
templatedStringSuffix?: string;
}): string;