Changes

Jump to: navigation, search

Coding for translation

20 bytes added, 15:59, 14 March 2011
m
Tips for writing a translatable report
into <code>/po</code> directory.
==Tips for writing a translatable reportPython module==
===Use complete sentences===
Don't build up a sentence from phrases. Because a sentence is ordered in a particular way in your language does not mean that it is ordered the same way in another. Providing the entire sentence as a single unit allows the translator to make a meaningful translation.
===Provide separate strings for masculine and feminine.===
Many languages have the concept of gender, while others don't. A sentence may need to be phrased differently depending on if whether the subject is male or female. By using the named %s values along with a bit of code, this problem can be solved.
if person.getGender() == Person.male:
===Provide a context support.===
Translator A translator needs context for a good translation. Keep in mind you can help him/her, by using context on translation string.
We need to call module :
Translation string will use context, but this will be hidden on user interface.
_("context|string")
Translator will see the translation string and an a help string without loading program.Program will only display the string in English or with an other another locale.
==Textuals reports==
64
edits

Navigation menu