Automatically detect and fix untranslated text in AngularJS applications. This tool scans your HTML files, detects untranslated text, adds translation attributes, and updates your JSON translation files.
- 🔍 Automatic detection of untranslated text
- 🏷️ Automatic addition of
translateattributes - 📝 Smart translation key generation
- 📦 JSON translation file updates
- 🌍 Multi-language support (default: en, fr)
- 🔄 Preserves existing translations
- ⚡ Fast and easy to use
npm install angularjs-i18n-detector --save-dev# Basic scan
npx angularjs-i18n-detector -s src/app -t src/i18n
# Specify languages (default: en,fr)
npx angularjs-i18n-detector -s src/app -t src/i18n -l en fr es-s, --source: Directory containing HTML files to scan-t, --translations: Translation files directory-l, --languages: List of languages (space-separated)
<div>
<h1>Welcome to my app</h1>
<p>Please select your language</p>
</div><div>
<h1 translate="WELCOME_TO_MY_APP">Welcome to my app</h1>
<p translate="PLEASE_SELECT_YOUR_LANGUAGE">Please select your language</p>
</div>// en.json
{
"WELCOME_TO_MY_APP": "Welcome to my app",
"PLEASE_SELECT_YOUR_LANGUAGE": "Please select your language"
}
// fr.json
{
"WELCOME_TO_MY_APP": "Bienvenue sur mon application",
"PLEASE_SELECT_YOUR_LANGUAGE": "Veuillez sélectionner votre langue"
}- Scans HTML files for untranslated text
- Generates translation keys from text content
- Adds
translateattribute with generated key - Updates JSON translation files
- Preserves existing translations
- Sorts keys alphabetically
npm testContributions are welcome! Feel free to open an issue or submit a pull request.
ISC