problems with firefox3 po file in launchpad
Jeroen Vermeulen
jtv at canonical.com
Fri May 9 20:37:42 BST 2008
Christian Robottom Reis wrote:
> On Thu, May 08, 2008 at 09:36:00PM +0200, Milo Casagrande wrote:
>> Il giorno gio, 08/05/2008 alle 17.45 +0200, Frco. Javier Rial ha
>> scritto:
>>> #We were unable to import the file because of errors in its format:
>>> #
>>> #PO file: duplicate msgid ending on line 73
>>>
>>> I execute "msgfmt -c _firefox-gl.po" to check the file and the command
>>> gives me 640 duplicated strings.
>>>
>>> The same happens if i open the untranslated PO file, translate only 1
>>> string (manually) and save that file.
>>> If I upload that file, launchpad gives me the same answer.
>>>
>>> Can someone explain me what I'm doing wrong?? Maybe a problem with the
>>> Firefox3 po files in Launchpad??
>>>
>>> Any help will be appreciated.
>>>
>>> Thanks from galician community.
>> The problem, I think, is due to the fact that Firefox does not support
>> the po format itself, it uses something else IIRC (rdf files and the
>> like). When I was looking at the translations of Firefox I found some
>> duplicated strings, something that with a po file would have never
>> happened.
>
> I think this is a bug that Jeroen has fixed last week and is negotiating
> a roll-out with me for. I'm just consulting with <asac> but this should
> be resolved in the next 24h. Thanks for raising it!
These are separate but related issues.
The duplicated strings, as I understand the initial report, are an error
that gettext is right to complain about. It sounds like the PO file
simply contains multiple messages with the same msgid (and without
different "msgctxt" context strings to differentiate them), which is not
correct in gettext. It doesn't matter whether those strings are
translated or not: what matters is that the duplications are in the file
at all.
Next, indeed, Firefox uses the XPI format. (An XPI file is basically a
zip archive containing an RDF file and a manifest, and DTD and
properties files, some of which may in turn be inside jar archives).
We're now using this format for Firefox in Ubuntu, but we can't export
it natively yet, and importing a gettext file into an XPI-based
translation won't work yet either. If you tried importing one, in
principle it should _seem_ to work; you wouldn't get an error, but the
imported messages would not show up in the UI.
Finally there's the bug I fixed last week. This was a bug that broke
imports of some XPI files. That is clearly not the issue here, but it
will allow us to re-import the upstream translations. This is needed
because another recent fix changed the message context strings for most
translatable messages imported from XPI.
That change in context strings was needed (and this is where we come
full circle) because two files inside the same XPI archive can have
messages with the same identifier. You can probably convert a file like
that to gettext without problems, but it would probably not be a correct
gettext file: gettext would complain about the duplications.
The fix solves that by giving each message a well-defined context
string. A nasty side effect is that existing Firefox translations made
in Launchpad will be turned into suggestions. This is a growing pain we
will have to go through once.
Jeroen
More information about the launchpad-users
mailing list