Re: [PATCH] Use named parameters for translatable strings with multiple params.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 1, 2009 at 4:11 PM, David Cantrell <dcantrell@xxxxxxxxxx> wrote:
> On Thu, 1 Oct 2009, Jeremy Katz wrote:
>> On Thu, Oct 1, 2009 at 12:48 AM, David Cantrell <dcantrell@xxxxxxxxxx> wrote:
>>> This patch modifies the reported format strings to use named parameters
>>> per the warning message.  We were already using these style format
>>> strings in users.py and possibly other files.  Basically when there is
>>> more than one parameter in the format string, we should use a hash table
>>> with named parameters.
>>
>> At one point, msgcheck wasn't properly making sure that the parameters
>> used in the translated versions of the strings matched those from the
>> original.  If that's still the case, it raises the possibility of a
>> lot more tracebacks from translator typos which would be good to avoid
>> as there's no way we'll get 100% testing coverage of every string hit
>> in every language.
>>
>> If not, then I'm all for it, although it does complicate things a little
>> bit
>
> I'm not sure if msgfmt does anything to verify that now, but the translators
> would get the strings from the anaconda.pot file anyway.

It verifies that if you have an original string like
  "the %s dog has %d toys"
that in the translation you have something like
  "het %s ogd ash %d oyst"
instead of
  "het %d ogd ash %d oyst"

I don't know that it checks for problems like "%{foo}s" becoming "%{fo}s".

> I'd like to give the translators more flexibility for reorganizing the
> translated string, since some translations could benefit from that.  If it's
> too much of a problem and we're in traceback city, we can just revert this.

IT's not trivial to revert, though -- once translators start
translating in the new style, if we switch back, we've broken all of
their translations.  Checking to see if msgfmt -c does the right check
should be straightforward enough.  And if it doesn't, we really can
probably hack something up without too much difficulty.  But if we
have to do that, it's going to push the impetus of it being right to
us to fix rather than something caught at translation "commit" time[1]

- Jeremy

[1] Okay, transfix periodically stops running msgfmt -c -- but when I
notice that, I yell at dglezos to turn it back on :-)

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux