[Yum-devel] [PATCH] Add po/Makevars for gettext plural handling

James Antill james at fedoraproject.org
Wed Nov 11 19:54:46 UTC 2009


On Wed, 2009-11-11 at 21:08 +0200, Ville-Pekka Vainio wrote:
> While translating yum into Finnish a couple of things started to bother
> me with the source. 
> 
> - ngettext (or _P) is not actually used anywhere, which pretty much
> breaks the l10n for languages with more than two plural forms

 Yeh, that's known about. IIRC it was added was just before a release,
so we added the API call to help the submitter do the conversion but
didn't want the big change until after the release ... then it just got
forgotten about or missed.
 Changing it now might be a good time to do so, as F12 is done and AFAIK
there are no plans for a 3.2.26 "soon".

> - the arguments are unnamed, which xgettext actually warns about if run
> on its own:
> 
> "'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."

 Yeh, this is a known issue. It's not obvious which way to go though, we
have at least three options:

1. "%% %(foo)s %(bar)s" % {'foo' : foo, 'bar' : bar}

2. string.Template('s.T $foo $bar').substitute({'foo' : foo, 'bar' : bar})

3. string.Formatter().format('s.F {0} {1}', foo, bar)

...I have preferences here but can't speak for everyone. We know we need
to come to some kind of conclusion "soonish", but you will probably be
the first person really pushing for it.

> I'd like to try fixing at least some of these issues. I'm new to yum
> developmen and the patch in this thread is my first patch. It should
> work if there were any P_ calls in the yum source code.

 The patch is fine, if no one else gets around to it I'll add it.

> I'd like to start converting code to use P_, but how should I send the
> patches? Would one source file per patch be ok? Any hints in general? I
> couldn't find any committer guidelines at the website.

 I'd do two patches:

1. Convert everything outside yum/*.py (ie. all the local to yum cli
code).

2. Convert the logging calls in yum/*.py.

-- 
James Antill <james at fedoraproject.org>
Fedora


More information about the Yum-devel mailing list