A CLI tool for translating locale files for @eliware/discord framework Discord apps. It uses OpenAI to generate translations for all supported Discord locales from a single English source file.
- Translates
en-US.jsonto all Discord-supported locales - Parallel translation with progress bar
- Designed for use with the skeleton Discord.js app template
cd /opt # Clone the repository git clone https://github.com/eliware/translate.git cd translate npm install # (Optional) Run tests npm test # Copy and edit the .env file cp .env.example .env # (Optional) Symlink for global CLI usage # (Requires sudo/root) ln -s /opt/translate/translate.mjs /usr/bin/translate-
Obtain an OpenAI API key and add it to your
.envfile:OPENAI_API_KEY=your_openai_api_key_here
-
Place your English translations in
en-US.jsonin your target directory (e.g., your Discord bot'slocales/folder).
cd /your_other_project/locales/ translate- The tool will read
en-US.jsonand generate translations for all other supported Discord locales in the same directory. - If a locale file already exists, it will be overwritten.
- All Discord-supported locales, including: bg, cs, da, de, el, en-GB, es-419, es-ES, fi, fr, hi, hr, hu, id, it, ja, ko, lt, nl, no, pl, pt-BR, ro, ru, sv-SE, th, tr, uk, vi, zh-CN, zh-TW
src/- Main source codeexample/- Example locale filestests/- Test suite
For help or questions, join the community and chat with the author:

