UNPKG

i18n-ai-translate

Version:

Use LLMs to translate your i18n JSON to any language.

39 lines (38 loc) 2.03 kB
import type OverridePrompt from "../interfaces/override_prompt"; /** * Prompt an AI to convert a given input from one language to another * @param inputLanguage - The language of the input * @param outputLanguage - The language of the output * @param input - The input to be translated * @param overridePrompt - An optional custom prompt * @returns A prompt for the AI to translate the input */ export declare function generationPrompt(inputLanguage: string, outputLanguage: string, input: string, overridePrompt?: OverridePrompt): string; /** * Prompt an AI to correct a failed translation * @param inputLanguage - The language of the input * @param outputLanguage - The language of the output * @param input - The input to be translated * @returns A prompt for the AI to correct the failed translation */ export declare function failedTranslationPrompt(inputLanguage: string, outputLanguage: string, input: string): string; /** * Prompt an AI to ensure a translation is valid * @param inputLanguage - The language of the input * @param outputLanguage - The language of the output * @param input - The input to be translated * @param output - The output of the translation * @param overridePrompt - An optional custom prompt * @returns A prompt for the AI to verify the translation */ export declare function translationVerificationPrompt(inputLanguage: string, outputLanguage: string, input: string, output: string, overridePrompt?: OverridePrompt): string; /** * Prompt an AI to ensure a translation is styled correctly * @param inputLanguage - The language of the input * @param outputLanguage - The language of the output * @param input - The input to be translated * @param output - The output of the translation * @param overridePrompt - An optional custom prompt * @returns A prompt for the AI to verify the translation */ export declare function stylingVerificationPrompt(inputLanguage: string, outputLanguage: string, input: string, output: string, overridePrompt?: OverridePrompt): string;