CLI Documentation

Configuration

{
  "projectName": "YOUR ChampoAI PROJECT_NAME",
  
  "translationFolder": "./translations",
  // OR
  "sourceFile": "./translations/fr-FR.json",

 // required only if you use "npx champo raw-translation"
  "sourceLang": "fr-FR",
  "targetLangs": ["en-US", "es-ES", "it-IT"]
  
  // optionnal (prefix to avoid file replacement) 
  "aiGeneratedPrefix": "ai-generated_",
  
  // optionnal (only have effect if "translationFolder" is set)
  "excludedFiles": ["file_to_exclude.ts"],
  "includedFiles": ["file_to_translate.json"],
}

npx champo status

Show infos about your ChampoAIarrow-up-right account (remaining tokens, used source keys and languages...).

npx champo status --project [projectName]

Show infos about one of your ChampoAIarrow-up-right project (used source keys, languages, missing keys...).


npx champo push

This command send your I18n JSON files to ChampoAI. Pushing your source lang file is a required step to be able to translate only missing or updated values.

After this command, you will also be able to invite traducers and allow product manager to update I18n files with an intuitive web UI on https://champo.aiarrow-up-right.

npx champo push --source

Default of npx champo push.

Push your source lang I18n JSON file(s), based on your config ./config.champo.json.

npx champo push --all --status [ 'manually_added' | 'ai_generated' | 'valid']

Push all your I18n JSON files, based on your config ./config.champo.json. You can also set the status of uploaded "outputLangs" value to help traducers to review them.


npx champo translate

This command translate is more effective than direct-translate. It translate only missing keys based on I18n JSON values pushed on ChampoAIarrow-up-right.

After this command, you need to run npx champo pull to download your files with newly translated values into your project.

npx champo translate --missings

Default of npx champo translate.

Find missing translated keys based on your synced JSON files and language set on ChampoAIarrow-up-right File Editor (see npx champo push) and translate them.

npx champo translate --lang [outputLang]

Same as npx champo translate --missings, but only for selected outputLang. Find missing translated keys based on your synced files on ChampoAIarrow-up-right (see npx champo push).


npx champo pull

This is will download I18n JSON files

npx champo pull --all

Default of npx champo pull.

Replace all I18n JSON file(s) synced on ChampoAI into your project.

npx champo pull --lang [lang]

Replace selected [lang] I18n JSON file(s) synced on ChampoAI into your project.

npx champo pull --source

Replace your source I18n JSON file(s) synced on ChampoAI into your project.


npx champo raw-translation

This command directly translate any type of I18n files. This will create and/or replace I18n files based on path set in your config ./config.champo.json or located at --file [sourceFilePath].

translationFolder: [translationFolder]/[outputLang]/[sourceFilename]

sourceFile: [sourceFileFolder]/[outputLang]-[sourceFilename]

sourceFilePath: [translationFolder]/[outputLang]-[sourceFilePath]

npx champo raw-translation --all

Directly translate all your I18n files, based on your config ./config.champo.json

npx champo raw-translation --file [sourceFilePath]

Directly translate an I18n file, located at [sourceFilePath]

Last updated