google-auto-translate
v0.0.3
Published
Translate language files using google translate service and diff tools.
Downloads
4
Maintainers
Readme
google-auto-translate
Translate language files using google translate service. This module improves performance and decrases rate limit usage by working with file diffs only.
Note: This module is not stable yet, use with caution.
Install
npm install google-auto-translate
Usage
CLI
.\node_modules\.bin\google-auto-translate [apiKey] [inputFile] [inputLanguageIsoKey] [generatedFilesDir] [targetLanguage1,targetLanguage2,...]
.\node_modules\.bin\google-auto-translate [apiKey] ./en.json en ./ de,fr,it
apiKey
: Your google translate api keyinputFile
: Source language json file from which the target languages will be generated from. Must be an object like the following:
{
"USER_HEADER": "English Header Value",
"ADMIN_AREA": {
"SECTION_1": {
"USER_GREETING": "Hello user",
"USER_DELETE_CONFIRM_TEXT": "Are you sure to delete the user?"
}
}
}
inputLanguageIsoKey
: Input file language key, example: engeneratedFilesDir
: Location of the generated files.targetLanguage1,targetLanguage2,...
: ISO language keys of the generated languages, examples:- en
- de
- tr
- it
- fr
- Full list: https://cloud.google.com/translate/docs/languages
Todos
- Rate Limiting (Currently google quota has 100.000 characters every 100 seconds)
- Unit Tests
- Better/More unit testable code structure