Re: Translations for LSR project



On 6/7/06, Peter Parente <parente gmail com> wrote:
I just noticed Christrian contributed a partial sv.po translation. Thanks!

One thing I should point out is that some of the strings in the
template have %s in them indicating the will be filled with some value
at run time. These %s must also appear in the translated string
otherwise Python will throw an exception when it tries to fill in the
runtime value.

The reason for having the %s in the string is to allow the translator
to decide where the template word should appear in their respective
language. For instance, the slot in "A device with name %s failed to
load" might need to appear in a different position in a different
language for it to make sense.

Is this a familiar concept for translators? If not, I'll add a note
about it to our README.translators file.

Yes, it is a most familiar concept. It's the same thing with
*printf()-based messages in languages like C or C++.
xgettext should automatically detect these specifiers in gettextisized
strings and automatically mark the affected messages with the keyword
"python-format". This means that later in the process when msgfmt is
invoked, msgfmt will check whether the number of %s in the original
msgid and the translated msgstr is equal for those messages, and issue
an error if not. This of course does not apply if the message is
untranslated or fuzzy-marked, then the message is counted as not being
translated and such checks are not performed.

Translators are instructed to always validate their po files with
msgfmt before committing, so this type of problem should be caught
before committing, assuming the messages have been properly marked
with python-format of course. If you find instances where a string is
using %s or a similar specifier and is not being marked with
python-format, then it is a real problem.


Speaking of specifiers, a thing I wanted to mention is the following
type of messages:

#: ../src/LSRMain.py:179
#, python-format
msgid "A %s with name %s was removed from profile %s"

The second and third specifier should not be a problem here, I think.
I assume that they are filled with the name and then the name of the
profile, respectively. If you want to help translators with their
assumptions, please use translator comments; they would be good to
have in either case.

Anyway, the problem is the first specifier in this sentence: "A %s with..."
It seems like a noun will get inserted there. Please do not insert
nouns into sentences with specifiers. I doubt this will even work with
English; if the noun was "apple", "A apple with..." would be wrong.
The problem gets much worse with other languages that may use
different genders for different nouns, and then prefixes or even whole
sentences may have to be rewritten depending on the gender of the
noun.

Please use full sentences instead:

"A parameter with name %s was removed from profile %s"
"An attribute with name %s was removed from profile %s"
"A tag with name %s was removed from profile %s"

etc.


Christian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]