Posted the revised patch<br>(<a href="http://patchwork.sugarlabs.org/patch/1134/">http://patchwork.sugarlabs.org/patch/1134/</a>)<br><br>Thanks Gonzalo and Chris.<br><br>Regards,<br>Ajay<br><br><div class="gmail_quote">On Sat, Jan 21, 2012 at 2:26 AM, Gonzalo Odiard <span dir="ltr"><<a href="mailto:gonzalo@laptop.org">gonzalo@laptop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I don't know.<br>The documentation [1] and [2] show only single line comments,<br>and I could not found one example of multiple lines comments in our code.<br>
<br>Gonzalo<br><br>[1] <a href="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" target="_blank">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</a><br>
[2] <a href="http://babel.edgewall.org/wiki/Documentation/messages.html#translator-comments" target="_blank">http://babel.edgewall.org/wiki/Documentation/messages.html#translator-comments</a><div><div></div><div class="h5">
<br><br>Just one more question, can the "TRANS" label string span multiple lines?<br>
</div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div></div><div class="h5">That is, is something like ::<br>
<br> # TRANS: first line text<br> # second line text<br>
# third line text<br>correct?<br><br>or it needs to be ::<br><br> # TRANS: first line text second line text third line text<br><br><br>Looking forward to a reply.<br><br><br>Regards,<br>Ajay<div>
<div><br>
<br><div class="gmail_quote">On Fri, Jan 20, 2012 at 7:23 PM, Chris Leonard <span dir="ltr"><<a href="mailto:cjlhomeaddress@gmail.com" target="_blank">cjlhomeaddress@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>On Fri, Jan 20, 2012 at 8:31 AM, Gonzalo Odiard <<a href="mailto:gonzalo@laptop.org" target="_blank">gonzalo@laptop.org</a>> wrote:<br>
> The problem is the substitution of a single string to translate here:<br>
><br>
> secondary_text = _('%(hour)d:%(min).2d remaining') % \<br>
> {'hour': remaining_hourpart, 'min':<br>
> remaining_minpart}<br>
><br>
> by a concatenation here:<br>
><br>
> time_value = '%(hour)d:%(min).2d ' % \<br>
> {'hour': remaining_hourpart, 'min':<br>
> remaining_minpart}<br>
> secondary_text = time_value + _('remaining')<br>
><br>
> The string to translate should be one, the the translator can reorder as<br>
> needed.<br>
<br>
</div>I agree with Gonzalo, any concatenation is very bad i18n practice. A<br>
complete phrase can be properly translated to conform to the syntax of<br>
any language. I do not believe there is a need to change the string<br>
itself, I would leave it as is.<br>
<div><br>
><br>
> But the bug say "This string could use a developers comment clarifying what<br>
> gets translated.<br>
> It is often done incorrectly in our Pootle instance."<br>
><br>
> I think he refer to add a line as:<br>
><br>
> # TRANS: Remaining battery time.<br>
<br>
</div>I would probably suggest<br>
<br>
# TRANS: do not translate %(hour)d:%(min).2d it is a variable, only<br>
translate the word "remaining"<br>
<br>
What I commonly see is the local words for hour and minute inserted in<br>
the variable, causing a printf error, whcih will break a software<br>
build.<br>
<div><div></div><div><br>
><br>
> This comment will be used by gettext and displayed in the pootle server to<br>
> help the translators<br>
><br>
> You can see one example here:<br>
> <a href="http://git.sugarlabs.org/sugar/mainline/blobs/master/extensions/cpsection/updater/view.py#line381" target="_blank">http://git.sugarlabs.org/sugar/mainline/blobs/master/extensions/cpsection/updater/view.py#line381</a><br>
><br>
> I am copying to Chris to confirm if this was the intention of the bug<br>
> filled.<br>
><br>
> Gonzalo<br>
</div></div></blockquote></div><br>
</div></div><br></div></div><div class="im">_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>