-
translate [...locales]
: sync all locale json files with the default locale json file.- translates all locales, skip locales that exactly match the default locale
- find missing keys in locales, add placeholder strings, get translations with one gpt request, put translations back to their correct places
- options:
-
-f, --force
: force to translate all locales
-
-
add <key> [...text]
: add a key to the default locale json file, and translate it to all the locales.- known issue: doesn't create new locale json files if they don't exist
- USE THE SAME PROMPT AS
translate
- options:
-
-l, --locale <locale>
: translate only the specified locale -
-f, --force
: force add key overriding existing ones
-
-
del <...keys>
: delete keys from locales.-
-l, --locale <locale>
: delete only from the specified locale
-
-
locales:
all
is every locale,def
is the default locale, anden
is a shorthand foren-**
-
tidy
: check the setup, reorder locale json files alphabetically or to the default locale json (ordering can get messed up when usingadd
), it can also be a quick way to check if all locals have the same shape (or the translate command is needed) -
llm protection: show key counts before and after the add or translate commands. they shouldn't remove keys under any circumstances, so prompt the user for confirmation.
-
context window: provide a way to add extra information to the gpt request
-
context: string
config: this just gets added to the prompt by default -w, --with [locale]
-
string
commonarg: add a locale json to the prompt -
boolean
commonarg: do not add the context string to the prompt
-
-
-
i18n loader
- REFACTOR (why do you think machine learning happens in steps?)
- make
--cwd
actually work - setup command to add i18n to new projects
- support a ton of i18n frameworks
- validate config (like locales, models, etc) with checkArg
-
verify
: reflect on the quality of the translations, check if the translations are accurate -
convert
command: convert a project to use i18n by extracting all the strings from the code and adding them to the locale json files. -
undo
: undo the last command, store prev file in .lin folder - support claude and friends (what's the best way to support them all??)