champo-ai
v1.4.1
Published
A package to translate i18n files with AI
Downloads
5
Readme
Get started
- Install package
npm i champo-ai
# or
yarn add champo-ai
- Create a champo.config.json at root of your project
{
"translationFolder": "./translations",
// OR
"sourceFile": "./translations/fr-FR.json",
"sourceLang": "fr-FR",
"outputLang": ["en-US", "es-ES", "it-IT"],
// optionnal
"excludedFiles": ["file_excluded.ts"],
"includedFiles": ["file_to_translate.json"],
"aiGeneratedPrefix": "ai-generated_"
}
- Export your api key
export CHAMPO_API_KEY=your_api_key # replace with yours
- Run translation script
npx champo translate
It will translate all files in ./{translationFolder}/{sourceLang} in desired languages automatically.