[Sugar-devel] Translations: We need help from activity maintainers
cjlhomeaddress at gmail.com
Fri Sep 23 12:43:35 EDT 2011
On Fri, Sep 23, 2011 at 6:56 AM, Simon Schampijer <simon at schampijer.de> wrote:
>> ####### Checking POT for browse (master) ######
>> Already up-to-date.
>> downloadmanager.py:344: warning: 'msgid' format string with unnamed
>> arguments cannot be properly localized:
>> The translator cannot reorder the
>> Please consider using a format string with
>> named arguments,
>> and a mapping instead of a tuple for the
> Hmm, not sure I understand what to change exactly, can you (or someone else)
> show me what this means in code?
> self.dl_jobject.metadata['title'] = _('Downloading %s from \n%s.') % \
> (self._get_file_name(), self._source.spec)
"The translator cannot reorder the arguments." errors have to do with
strings that contain more than one variable substitution.
get file %s from directory %s
I'm not entirely sure of the correct way to do the i18n of these, but
the issue is that the two %s can't be distinguished from each other
and any given language's syntactic structure (e.g. object-subject
ordering) might require re-ordering them.
From-foo the directory-bar %s obtain-foo the file-bar %s
I think this can be solved with named variables
get file %(file)s from directory %(directory)s
However, we know from experience that this can easily lead to printf
errors when the localizers translate the variable name inside the
parentheses. On the other hand, these errors are easy to detect
(pofilter flags them in Pootle Review tab) and generally easy to fix,
even for a non-speaker. (switch the mangled variable back to the
original untranslated form), although fixing can get a little trickier
in RTL langs,
Unfortunately, at the moment, the gnu servers seem to be having issues
(500 internal server error) but the gettext manual might be the best
place to look for preferred or alternate solutions to these errors.
More information about the Sugar-devel