<br>On Fri, Sep 23, 2011 at 11:43 AM, Chris Leonard <span dir="ltr"><<a href="mailto:cjlhomeaddress@gmail.com">cjlhomeaddress@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, Sep 23, 2011 at 6:56 AM, Simon Schampijer <<a href="mailto:simon@schampijer.de">simon@schampijer.de</a>> wrote:<br>
>><br>
>> ####### Checking POT for browse (master) ######<br>
>> Already up-to-date.<br>
>> downloadmanager.py:344: warning: 'msgid' format string with unnamed<br>
>> arguments cannot be properly localized:<br>
>> The translator cannot reorder the<br>
>> arguments.<br>
>> Please consider using a format string with<br>
>> named arguments,<br>
>> and a mapping instead of a tuple for the<br>
>> arguments.<br>
><br>
> Hmm, not sure I understand what to change exactly, can you (or someone else)<br>
> show me what this means in code?<br>
><br>
> self.dl_jobject.metadata['title'] = _('Downloading %s from \n%s.') % \<br>
> (self._get_file_name(), self._source.spec)<br>
><br>
> Thanks,<br>
> Simon<br>
><br>
<br>
</div>"The translator cannot reorder the arguments." errors have to do with<br>
strings that contain more than one variable substitution.<br>
<br>
get file %s from directory %s<br>
<br>
I'm not entirely sure of the correct way to do the i18n of these, but<br>
the issue is that the two %s can't be distinguished from each other<br>
and any given language's syntactic structure (e.g. object-subject<br>
ordering) might require re-ordering them.<br>
<br>
pseudo-geek translation<br>
From-foo the directory-bar %s obtain-foo the file-bar %s<br>
<br>
I think this can be solved with named variables<br>
<br>
get file %(file)s from directory %(directory)s<br>
<br></blockquote><div><br></div><div>I've tested this change and it avoids the gettext warning and has not any impact on the POT (at least on Speak's case). </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
However, we know from experience that this can easily lead to printf<br>
errors when the localizers translate the variable name inside the<br>
parentheses. On the other hand, these errors are easy to detect<br>
(pofilter flags them in Pootle Review tab) and generally easy to fix,<br>
even for a non-speaker. (switch the mangled variable back to the<br>
original untranslated form), although fixing can get a little trickier<br>
in RTL langs,<br>
<br>
Unfortunately, at the moment, the gnu servers seem to be having issues<br>
(500 internal server error) but the gettext manual might be the best<br>
place to look for preferred or alternate solutions to these errors.<br>
<br>
<a href="http://www.gnu.org/software/gettext/manual/gettext.html" target="_blank">www.gnu.org/software/gettext/manual/gettext.html</a><br>
<br>
cjl<br>
<div><div></div><div class="h5">_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">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>
</div></div></blockquote></div><br>