Contents  History  Source  Email Feedback

Variables and the localiser

Commenting

A message that lists 3 variables but doesn't tell anything to the translator
about what the strings will contain does not help a translator.  Even if you
think the contents of the variable are self explanatory think again.

Here is an example of a poorly commented message:

msgid ""
"%s returned %s after %s"

Your guess is as good as mine.

A better implmenetation would have the following:

# %s - a URL
# %s - the error message
# %s - time as HH:MM:SS since the command was executed
msgid ""
"%s returned %s after %s"

Allowing reordering

English speakers assume that language order will not change.  In many languages
the order of sentences will be different from that of English.  Many systems
allow for variables to be reoordered.  Please ensure that your variables can be
reordered.

A dictitious translation of the above examples may appear like this:
msgid ""
"%s returned %s after %s"
msgstr ""
"Returning %2s was %1s after %3s"

As you can see by allowing reordering the translator can convery the message in
the structure of their language.