bug-binutils
[Top][All Lists]
Advanced

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

Re: Translatable strings not marked 'c-format'


From: Ask Hjorth Larsen
Subject: Re: Translatable strings not marked 'c-format'
Date: Thu, 20 Oct 2016 16:34:32 +0200

Hi Nick

I just tested a message like this:

#: coff-sh.c:2780 cofflink.c:2964
#, c-format
msgid "%B: illegal symbol index %ld in relocs"
msgstr "%A: advarsel: illegalt symbolindeks %ld i relokeringerne"

Note how the translation contains an erroneous %A instead of the correct %B.

This is accepted by msgfmt.  Thus, the c-format flag cannot validate
these codes.  It also accepts the message if %A or %B is omitted.

The reason why msgfmt does not recognize them is that the %A/%B codes
are defined by the error handler (bfd.c around line 600).   Meanwhile,
msgfmt is only aware of the codes of printf.

I see "/* Invoking %A with a null section pointer is an internal
error.  */", followed by abort(), which means that superficially valid
translation files can very easily result in abort() or possibly buffer
overruns.

My recommendation is to use the same string codes as printf.  Then
faulty translations will be rejected by translationproject.

I wrote a script to verify existing translations on the web page, and
those that I tested had at least a few errors each.

Best regards
Ask


2016-10-20 12:47 GMT+02:00 Nick Clifton <address@hidden>:
> Hi Ask,
>
>> Do you know when the translation
>> templates on translationproject.org will be updated?
>
> On translationproject.org - no.  But I have just updated the
> bfd.pot template in the binutils source repository (which I
> forgot to do yesterday, sorry).
>
> Cheers
>   Nick
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]