Now that Ubiquity 0.5 is on the verge of release, we have scrambled to demonstrate the localization-possibilities by including a couple of alternative languages for the standard feeds (and for the new parser.)
By the looks of it, the languages Catalan, Danish and Japanese are going to make it in, but we hope more will join them before the 0.6 release.
Being a localizer myself (I did the Danish translation) I know the pain of keeping up with ever-changing-, new- and deleted keys. Mostly for my own benefit, I have put together a script that helps you track changes between the templates and the translations. If you place this script in your ubiquity/localization/ folder and run it, it should list relevant information for each language.
Examples:
If you want all the information, simply run the script:
python localization.py
In the current development version, this produces quite a lot of output, so I’ll paste a representative section only:
$ python localization.py ! Missing translation: da/developer.po ! 2 keys are missing in pageedit(da): ---------------------------------------------------- ["If you used the 'edit page' command to put the page into editable mode, use this command to end that mode and go back to normal page viewing. If you want the changes to persist on page reload, issue the 'save' command first."] ---------------------------------------------------- ["Saves edits you've made to this page in an annotation. They will persist on page reload. You can remove them with the 'undo page edits' command."] ---------------------------------------------------- ! 2 keys are superfluous in pageedit(da): ---------------------------------------------------- ["If you used the 'edit page' command to put the page into editable mode, use this command to end that mode and go back to normal page viewing."] ---------------------------------------------------- ["Saves edits you've made to this page in an annotation. Undo with the 'undo page edits' command."] ----------------------------------------------------
If you just want an overview and not all the details (I imagine this will be useful for project leaders) you can run the command:
python localization.py | grep -E ^\!
which again produces a lot of information but looks something like:
$ python localization.py | grep -E ^\! ! Missing translation: da/developer.po ! 2 keys are missing in pageedit(da): ! 2 keys are superfluous in pageedit(da): ! 1 keys are missing in email(da): ! 1 keys are superfluous in email(da):
The future
The script is not yet added to the ubiquity source distribution, as there are still a lot of changes that I feel need to go in before it is production-ready. I plan to integrate more options into the script, making it easier to get the overview, getting info about only one language, or about only one template. It will also become smarter, and realize when a key has changed, and what it has changed to. Currently as the above example show, it lists each as a missing and superfluous key. As the deadline for 0.5 is looming, I don’t expect it to be ready by then.
For the adventurous localizer, I do think it will already in its present state be a big help, so feel free to try it out and report back with any suggestions, improvements or bugs you may encounter.
Happy hacking and translating,
– cers / Christian Sonne