A powerful multilingual properties file management tool designed for Java project internationalization (i18n). This tool helps you easily manage and synchronize translations in message-application.properties
files.
- 🤖 Smart Translation: Automated text translation using DeepSeek AI or Qwen (Tongyi) AI
- 🔑 Smart Key Generation: Automatically generates keys compliant with Java properties standards
- 🔄 Auto Sync: Automatic synchronization from Simplified Chinese (zh) to Traditional Chinese (zh_TW)
- 📝 Manual Management: Support for manual addition and update of translations
- 🔍 Check Tool: Verification of missing translation entries
curl -fsSL https://raw.githubusercontent.com/SimonGino/i18n-manager/main/install.sh | bash
Download the binary for your platform from the Releases page.
- Linux
- x86_64 (amd64)
- i386 (32-bit)
- arm64
- armv7
- macOS
- x86_64 (amd64)
- arm64 (Apple Silicon)
- Windows
- x86_64 (64-bit)
- i386 (32-bit)
Before first use, configure your API key:
-
Get your API key:
- For DeepSeek: Visit DeepSeek Dashboard
- For Qwen: Visit DashScope Console
-
Configure the API key and provider:
# Set AI provider (deepseek or qwen)
i18n-manager config --set-ai-provider qwen
# Set API key
i18n-manager config --set-api-key YOUR_API_KEY
The configuration file is located at ~/.config/i18n-manager/config.json
(or %APPDATA%\i18n-manager\config.json
on Windows). Here's an example configuration:
{
"api_key": "your-api-key",
"default_path": ".",
"ai_provider": "deepseek",
"language": {
"file_pattern": "message-application%s.properties",
"mappings": [
{
"code": "en",
"file": "",
"is_source": false
},
{
"code": "zh",
"file": "_zh",
"is_source": true
},
{
"code": "zh_CN",
"file": "_zh_CN",
"is_source": true
},
{
"code": "zh_TW",
"file": "_zh_TW",
"is_source": false
}
]
}
}
api_key
: Your AI provider API keydefault_path
: Default path for properties filesai_provider
: AI provider for translation (currently supports "deepseek" or "qwen")language
: Language configurationfile_pattern
: Pattern for properties files (e.g., "message-application%s.properties")mappings
: Language mappingscode
: Language code (e.g., "en", "zh", "zh_CN")file
: File suffix (e.g., "", "_zh", "_zh_CN")is_source
: Whether this is a source language for translation
You can modify these settings using the following commands:
i18n-manager config --set-api-key "your-api-key"
i18n-manager config --set-ai-provider "deepseek"
i18n-manager config --show # Show current configuration
Translate with auto-generated key:
i18n-manager translate "Text to translate"
Translate with custom key:
i18n-manager translate "Text to translate" --key "custom.key.name"
Add complete multilingual translations:
i18n-manager add \
--key "custom.key.name" \
--zh "简体中文" \
--en "English" \
--zh-tw "繁體中文"
Or add partial translations:
i18n-manager add \
--key "custom.key.name" \
--zh "简体中文" \
--en "English"
List all translation keys:
i18n-manager list
List translations for a specific key:
i18n-manager list --key "error.skill.unavailable"
# or use the short flag
i18n-manager list -k "error.skill.unavailable"
Check for missing translations:
i18n-manager check
Set API key:
i18n-manager config --set-api-key YOUR_API_KEY
View current configuration:
i18n-manager config --show
Configuration files are located at:
- Linux/macOS:
~/.config/i18n-manager/config.json
- Windows:
%APPDATA%\i18n-manager\config.json
Contains the following settings:
api_key
: API keydefault_path
: Default working directorydefault_source_lang
: Default source languagedefault_target_langs
: Default target language list
Generated keys follow these conventions:
- Use lowercase letters, numbers, and dots (.)
- Use dots (.) as hierarchy separators
- Use common prefixes for categorization:
error.
- Error messagessuccess.
- Success messagesinfo.
- Information promptslabel.
- UI labelsbutton.
- Button texttitle.
- Page/section titlesmsg.
- General messagesvalidation.
- Validation messages
Examples:
validation.username.notEmpty
success.data.saved
button.submit.text
The tool manages the following files in the specified directory:
message-application.properties
- English translationsmessage-application_zh.properties
- Simplified Chinese translationsmessage-application_zh_TW.properties
- Traditional Chinese translations
To uninstall the tool:
curl -fsSL https://raw.githubusercontent.com/SimonGino/i18n-manager/main/uninstall.sh -o uninstall.sh
chmod +x uninstall.sh
./uninstall.sh
- Remove executable
# Linux/macOS
rm $(which i18n-manager)
# Windows
del C:\path\to\i18n-manager.exe
- Remove configuration files (optional)
# Linux/macOS
rm -rf ~/.config/i18n-manager
# Windows
rd /s /q %APPDATA%\i18n-manager
- Clone the project:
git clone https://github.com/yourusername/i18n-manager.git
- Create the cmd directory structure:
mkdir -p cmd/i18n-manager
- Install dependencies:
go mod download
- Run tests:
go test ./...
Pull requests and issue reports are welcome!
MIT License