[Sugar-devel] [PATCH 2/5] sl#2815: Localization fixes.
Gonzalo Odiard
gonzalo at laptop.org
Fri Jan 20 15:56:56 EST 2012
I don't know.
The documentation [1] and [2] show only single line comments,
and I could not found one example of multiple lines comments in our code.
Gonzalo
[1]
http://wiki.laptop.org/go/Internationalization_in_Sugar#How_do_I_create_translation_comments_that_will_be_carried_over_in_to_the_generated_PO_files.3F_.5B1.5D
[2]
http://babel.edgewall.org/wiki/Documentation/messages.html#translator-comments
Just one more question, can the "TRANS" label string span multiple lines?
> That is, is something like ::
>
> # TRANS: first line text
> # second line text
> # third line text
> correct?
>
> or it needs to be ::
>
> # TRANS: first line text second line text third line text
>
>
> Looking forward to a reply.
>
>
> Regards,
> Ajay
>
>
> On Fri, Jan 20, 2012 at 7:23 PM, Chris Leonard <cjlhomeaddress at gmail.com>wrote:
>
>> On Fri, Jan 20, 2012 at 8:31 AM, Gonzalo Odiard <gonzalo at laptop.org>
>> wrote:
>> > The problem is the substitution of a single string to translate here:
>> >
>> > secondary_text = _('%(hour)d:%(min).2d remaining') % \
>> > {'hour': remaining_hourpart, 'min':
>> > remaining_minpart}
>> >
>> > by a concatenation here:
>> >
>> > time_value = '%(hour)d:%(min).2d ' % \
>> > {'hour': remaining_hourpart, 'min':
>> > remaining_minpart}
>> > secondary_text = time_value + _('remaining')
>> >
>> > The string to translate should be one, the the translator can reorder as
>> > needed.
>>
>> I agree with Gonzalo, any concatenation is very bad i18n practice. A
>> complete phrase can be properly translated to conform to the syntax of
>> any language. I do not believe there is a need to change the string
>> itself, I would leave it as is.
>>
>> >
>> > But the bug say "This string could use a developers comment clarifying
>> what
>> > gets translated.
>> > It is often done incorrectly in our Pootle instance."
>> >
>> > I think he refer to add a line as:
>> >
>> > # TRANS: Remaining battery time.
>>
>> I would probably suggest
>>
>> # TRANS: do not translate %(hour)d:%(min).2d it is a variable, only
>> translate the word "remaining"
>>
>> What I commonly see is the local words for hour and minute inserted in
>> the variable, causing a printf error, whcih will break a software
>> build.
>>
>> >
>> > This comment will be used by gettext and displayed in the pootle server
>> to
>> > help the translators
>> >
>> > You can see one example here:
>> >
>> http://git.sugarlabs.org/sugar/mainline/blobs/master/extensions/cpsection/updater/view.py#line381
>> >
>> > I am copying to Chris to confirm if this was the intention of the bug
>> > filled.
>> >
>> > Gonzalo
>>
>
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120120/8076aca0/attachment-0001.html>
More information about the Sugar-devel
mailing list