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.

24 lines (22 loc) 878 B
import type Options from "./options"; export default interface TranslateDiffOptions extends Options { inputLanguageCode: string; inputJSONBefore: Object; inputJSONAfter: Object; toUpdateJSONs: { [languageCode: string]: Object }; /** * Called after each per-language translation finishes. Lets callers * persist partial results to disk so a crash mid-run doesn't * discard already-paid-for translations. * * `translated` is the unflattened per-language object (file diff * callers write this straight to disk); `flatTranslated` is the * pre-unflatten flat map (directory diff callers split it on the * `filepath:key` delimiter their keys are encoded with). */ onLanguageComplete?: ( languageCode: string, translated: Object, flatTranslated: { [key: string]: string }, ) => void; }