-
Notifications
You must be signed in to change notification settings - Fork 2
Home
A Localization automator bot
Given a software project code base which needs to have multiple locale support,
- How can a program decide an idempotent key for a localizable element (e.g text label) in a given context in code for a developer
- How can a program extract all the used locale keys and default locale values occurring in the code base
- If we have an excel sheet with key and values, how can a program update locale files without manually copying the values from the sheet
- Protocol (locale key generation convention) to make locale keys idempotent
- No manual locale file management
- No human error in localization update
- Keep client localization sheets and locale files in project always in sync
- Should work for multiple platforms
- Automated locale file management
a. Insert and update locale from code occurrences
b. Insert and update from excel sheet- Export locale files as excel sheets
- Import locale files from excel sheets
- Platforms: JavaScript, iOS, Android
In some code, e.g
// locale key: common.title.label.appName // locale value for default english locale: Locale Bot row.lblLastName = i18n(common.title.label.appName); // Locale BotTo extract all locale key values from similar code occurances
$localebot extract --platform:iOS --dir:src
Or extract from specific file
$localebot extract --platform:iOS --file:src/views/pages/appLaunchScreen
This will update all locale files with default locale value
// bn.json { "common.title.label.appName": "Locale Bot" } // ja.json { "common.title.label.appName": "Locale Bot" } // en.json { "common.title.label.appName": "Locale Bot" }
Export the locale fiels to excel sheet for linguists to to update the locale values for different locales
localebot export --to:xls
This will export one excel file with one sheet for all locale at current localization state
localebot.xls
key bn en ja src.views.pages.patientdetailsViewController.label.firstname Locale Bot Locale Bot Locale Bot If the file was already localzed, the output would be something like:
localebot.xls
key bn en ja src.views.pages.patientdetailsViewController.label.firstname স্থানীয়করণ বট Locale Bot ローカリゼーションボット
After the excel sheet is updated by linguists
import the updated file back into project
localebot import --file:~/localebot.xls
This will update all locale files with latest values from the excel sheet
// bn.json { "common.title.label.appName": "স্থানীয়করণ বট" } // ja.json { "common.title.label.appName": "Locale Bot" } // en.json { "common.title.label.appName": "ローカリゼーションボット" }
- System for Automatic, idempotent, unique locale key suggestion
a. Suggest in code context
b. Automatic suggestion
b. Idempotent suggestion
b. Unique suggestion- Coding ide extension for
a. VSCode
b. Android Studio
c. Xcode
- Faster development: Not manage the locale files manually
- Easier identification of locale keys (readability of locale keys)
- Faster and always accurate replacement of translations