[Localization] [IMPORTANT] Getting your formatting strings right
Alexander Todorov
atodorov at redhat.com
Wed Feb 6 04:28:24 EST 2008
Alexander Dupuy wrote:
> Sayamindu Dasgupta writes:
>
>> While going through the translations, I found that some of the
>> translators are ignoring the formatting strings in the msgids. Eg,
>> they are translating "%d Foo" as "Bar" (where Foo->Bar) in their
>> language.
>> _Please, please, do not do this._ If you do this, the software will in
>> many cases crash while working in your language.
>>
>> To understand the use of these strings, and to know how to deal with
>> them, please do go through
>> http://www.bengalinux.org/devel_guide/ch03.html#transguide.poanatomy.specialcases
>>
>
> Note that there is another aspect of the formatting strings that is
> often getting ignored - these are the positional formatting strings. To
> take an example from the (otherwise excellent) set of screen shots for
> Translation for XO using Pootle that Sameer Verma just posted, the
> message "Downloading %(1)s from %(2)s" should NOT be translated as
> "Descargando %(1) desde %(2)" or the Hindi text (which I cannot type or
> copy-paste) that looks like "%(1) # %(2) ##### ## # ## #" (where the #
> are Hindi characters). Without the letter 's' after the parentheses,
> the localized string will not be displayed correctly.
>
All these are described in details (with examples) in the GNU gettext
manual pages:
http://www.gnu.org/software/gettext/manual/gettext.html
I've taken the time to read almost all of them and I was surprised how
many things I didn't know about how translations work. It's advisable
for any translator to take a look at these manuals. Although a bit
technical at places they give you a nice overview of the localization
system used in Linux.
Greetings,
Alexander.
More information about the Localization
mailing list