LocalePlanet Translation Tools
I use the GNU GetText tools/libraries to deal with the language translations at LocalePlanet.
These are utilities that I wrote to make everything work together. They are command line tools written in python. You can download them from github.
They all use the polib by David Jean Louis. I included the version of polib.py that I used in the repository.
These are all command line tools. You can get detailed parameter descriptions by running them with --help
.
File name | Description |
---|---|
gt4po.py | Runs untranslated strings through Google Translate. Results are marked as fuzzy so human translators know what needs to be checked. |
lpmirror.py | Mirrors scripts from LocalePlanet. |
po2intl.py | Creates a test translation with all the text converted to international: just switches each plain character to an equivalent Unicode character with some sort of accent/mark. When you run with this translation, any un-accented text has not been properly coded for translation. |
po2js.py | Moves translations from .po files to .js files so they can be included directly in a page. Very similar to po2json, but translations that start with "function(" treated as code instead of strings. |
po2json.py | Moves translations from .po files to .json files so they can be used directly by JavaScript code. |
po2prop.py | Moves translations from .po files to Java .properties files so they can be used directly by Java code. There is a po2prop utility in the translate-toolkit package, but it gave me a wierd error on a perfectly valid .po file, and it was easy enough to write my own version. |
translate.sh | the bash shell script that does everything. Not directly useful for anyone but me, but a good example of how all the pieces fit together. |