@eliware/translate
v1.1.1
Published
A tool for translating locale files for discord apps built on @eliware/discord
Downloads
110
Maintainers
Readme
@eliware/translate

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.
Features
- Translates
en-US.jsonto all Discord-supported locales - Parallel translation with progress bar
- Designed for use with the skeleton Discord.js app template
Installation
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/translateSetup
Obtain an OpenAI API key and add it to your
.envfile:OPENAI_API_KEY=your_openai_api_key_herePlace your English translations in
en-US.jsonin your target directory (e.g., your Discord bot'slocales/folder).
Usage
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.
Supported Locales
- 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
Project Structure
src/- Main source codeexample/- Example locale filestests/- Test suite
Support
For help or questions, join the community and chat with the author:
License
MIT © 2025 Eli Sterling, eliware.org


