[Sugar-devel] Translations: We need help from activity maintainers

Rafael Ortiz rafael at activitycentral.com
Fri Sep 23 15:46:16 EDT 2011


On Fri, Sep 23, 2011 at 11:43 AM, Chris Leonard <cjlhomeaddress at gmail.com>wrote:

> 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
> >> arguments.
> >>                                 Please consider using a format string
> with
> >> named arguments,
> >>                                 and a mapping instead of a tuple for the
> >> arguments.
> >
> > 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)
> >
> > Thanks,
> >   Simon
> >
>
> "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.
>
> pseudo-geek translation
> 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
>
>
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).



> 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.
>
> www.gnu.org/software/gettext/manual/gettext.html
>
> cjl
> _______________________________________________
> 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/20110923/d470eaee/attachment.html>


More information about the Sugar-devel mailing list