easy-translate-i18n
v1.1.3
Published
Simple and fast internationalization (i18n) CLI tool for managing JSON translation files.
Readme
Easy-translate-i18n
Simple and fast internationalization (i18n) CLI tool for managing JSON translation files.
Features
- 🚀 Fast compilation with SWC
- 📦 Easy configuration
- 🔄 Automatic missing translation detection
- 🌐 Multiple locale support
- ⚡ Command-line interface
Installation
# npm
npm install easy-translate-i18n
# yarn
yarn add easy-translate-i18n
# pnpm
pnpm add easy-translate-i18nQuick Start
- Create a configuration file
easy-translate-i18n.config.json:
{
"defaultLocale": "pt-BR",
"path": "./src/locales/{{locale}}.json",
"locales": ["pt-BR", "en", "es"]
}- Run the translation tool:
npx easy-translate-i18nConfiguration
You can configure easy-translate-i18n using any of these files:
easy-translate-i18n.config.jseasy-translate-i18n.config.json.easy-translate-i18nrc.easy-translate-i18nrc.json
Configuration Options
| Option | Type | Default | Description | | ------------- | -------- | ------------------------------- | -------------------------------- | | defaultLocale | string | 'pt-BR' | Source language for translations | | path | string | './src/locales/{{locale}}.json' | Path template for locale files | | locales | string[] | ['en'] | List of target locales |
Usage Examples
Basic Usage
# Generate translation files
npx easy-translate-i18n
# Watch mode
npx easy-translate-i18n --watchProject Structure
your-project/
├── src/
│ └── locales/
│ ├── pt-BR.json
│ ├── en.json
│ └── es.json
└── easy-translate-i18n.config.jsonContributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License - see the LICENSE file for details
