UNPKG

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.

19 lines (18 loc) 884 B
import type Glossary from "./interfaces/glossary"; /** * Load and validate a glossary JSON file. Unlike the cache, a malformed * glossary is a user configuration error, so this throws with a clear * message rather than silently ignoring it. * @param filePath - path to the glossary JSON file * @returns the parsed glossary */ export declare function loadGlossary(filePath: string): Glossary; /** * Build the glossary instruction block injected into a prompt for one * target language. Returns an empty string when nothing applies, so * callers can prepend it unconditionally. * @param glossary - the glossary, or undefined * @param outputLanguageCode - the run's target language code * @returns the instruction block (ending in a blank line), or "" */ export declare function buildGlossaryInstructions(glossary: Glossary | undefined, outputLanguageCode: string): string;