Changes

Jump to: navigation, search

Coding for translation

1,704 bytes added, 08:32, 24 July 2013
Tips for writing a translatable Python module
daughter: %s
which doesn't require genitive.
 
==Changing translated text message in the source code==
One of the severities in our bug tracker is "text", which ranks up as easier than "tweak" and "minor", but more difficult than "trivial". If a bug is concerned with readability or correctness of a text that Gramps outputs, whether in GUI, in a console error message, or in a produced report, then "text" is the severity to use. So why is it more than "trivial"?
 
As described above, any translated text in the source code gets reflected into tens of *.po files, maintained by the translators. So every time you just change it in the source, ALL the translators need to do the translation again. Normally, the translation environment will give a prudent suggestion, but there is still a manual approval step. If you check in the change, the string will not be translated until the translators pick it up.
 
This is why, if what you change is just a couple of spelling mistakes, a missing comma in the middle, or maybe an extra space somewhere in the message, it's a good idea to save the translators' work, by doing a global search and replace of your source message text in the *.po files, and committing these along with your change.
 
For short enough messages, that don't span multiple lines in the *po files, you can do it by executing
perl -pi -e 's/YOUR MESSAGE BEFORE CORRECTION/your message after correction/g;' *.po *.pot
in the po/ directory. Make sure you do an "svn diff" and observe the results make sense.
 
'''NOTE: '''to stress it again, only do it for text change that didn't change how it is going to be translated. If you'd like your change to be somehow reflected in the translations, let the translators do the work instead.
==Textual reports==
296
edits

Navigation menu