I can't upload firefox po files

Asked by Denis

Hello,

I have a problem uploading po files for Firefox.

I download a template from Rosetta, fullfilled it et upload it.

Rosetta was unable to import the file because of errors in its format:

PO file: duplicate msgid ending on line 65

I checked my file with msgfmt -c and had a lot of duplicate msgid.

I patiently corrected the file. And tried again to upload it.

Rosetta was unable to import it because I removed the tag it use to mark files exported from

Launchpad. Where did I ?

What's the way to comply to msgfmt -c and the Rosetta requirements to upload file ?

For infos here's the br.xpi (sources),

http://meskach.free.fr/arbo/Ubuntu-br/br.xpi
here's the fullfilled file downloaded from Rosetta

http://meskach.free.fr/arbo/Ubuntu-br/_firefox-br.po
and here's the file I changed to comply with the "msgfmt -c" command

http://meskach.free.fr/arbo/Ubuntu-br/corrige_3_firefox-br.po

Thank you for your attention,

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Denis
Solved:
Last query:
Last reply:
Revision history for this message
Alexander Sack (asac) said :
#1

firefox support in rosetta is still under development. For now the only way to import firefox translation is to import .xpi files.

So if you want to edit the .po file you exported you first need to transform it to a .xpi and then upload that instead of the .po

The tool to transform the .po to .xpi files lives in a bzr branch:

 https://code.edge.launchpad.net/~mozillateam/rosetta/po2xpi

It lacks good documentation as its ment as an intermediate solution on our way to export .xpi files directly from launchpad.

However, a community member as written a wiki page on "how to test your translations":

 https://wiki.ubuntu.com/MozillaTeam/Testing_your_translation

You can use that to get the idea how to produce the .xpi files which you could then import.

Revision history for this message
Denis (bibar) said :
#2

I tried to upload the br.xpi above-mentioned.
And it returns an error :
Line 1: Invalid content: u'PK\x03\x04'
It seems to have expected a po file.
Does it means that i have from my xpi to unpack it, to copy the lines in my po file, to runpo2xpi and upload this xpi ? Ga bu zo meu ?

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Jeroen T. Vermeulen (jtv) said :
#4

I'm sorry about the delay; it looks like I lost a batch of notification emails two weeks ago.

Revision history for this message
Jeroen T. Vermeulen (jtv) said :
#5

The "invalid content" is clearly the beginning of a zip archive, which is what an xpi file is. So this does look like something was expecting text and got a binary file instead.

What exactly gave you this error? The upload, or the conversion script?

Revision history for this message
Denis (bibar) said :
#6

The link in my first message is the br.xpi i tried to upload. It does'nt come a converted po file. I made it from a breton translation of FF3 for Windows. I made it handly, zipped with file-roller.
The error i received from Rosetta is not more precise.
I don't think it comme from the upload, but have no argument.

Revision history for this message
Jeroen T. Vermeulen (jtv) said :
#7

I tried uploading the br.xpi on the "staging" demo server, and it worked fine. Maybe I did something different. Could you give me the exact URL of the page where you tried to upload this file?

Revision history for this message
Denis (bibar) said :
#8

https://translations.launchpad.net/ubuntu/hardy/+source/firefox-3.0/+pots/firefox/br/+upload
And I think i tried for xulrunner too. Wasn't the good place ?

Revision history for this message
Jeroen T. Vermeulen (jtv) said :
#9

Thanks, I've reproduced it now! The importer believes that it's a PO file. It actually tells us so: there's a small text saying it's expecting a .po file. That's a leftover from the time when the only kinds of files it would ever see were .po and .pot—and uploading a .pot to a translation doesn't make sense. I'm converting this to a bug.

Meanwhile, does it work if you upload to the template, instead of specifically to the Breton translation? Try it here: https://translations.launchpad.net/ubuntu/hardy/+source/firefox-3.0/+pots/firefox/+upload

Revision history for this message
Denis (bibar) said :
#10

Jeroen,
https://translations.launchpad.net/ubuntu/hardy/+source/firefox-3.0/+pots/firefox/+upload
Sorry, logged in as Denis ARNAUD I don't have permission to access this page.

Revision history for this message
Jeroen T. Vermeulen (jtv) said :
#11

I'm sorry. The problem seems to be that you previously uploaded a gettext file, and now the format is sort of "sticking" to that format. I re-uploaded your file from the other form, so it should be fixed now.

Revision history for this message
Denis (bibar) said :
#12

Thanks a lot !
If you can do the same for xulrunner, it would perfect.

Revision history for this message
Jeroen T. Vermeulen (jtv) said :
#13

Same translation file, I take it? And do you mean xulrunner or xulrunner-1.9?

Revision history for this message
Denis (bibar) said :
#14

Same br.xpi (link above), for xulrunner-1.9 !
Thank you !

Revision history for this message
Jeroen T. Vermeulen (jtv) said :
#15

Done.

Revision history for this message
Denis (bibar) said :
#16

Thanks a lot !

Revision history for this message
Tran Vinh Tan (vinhtantran) said :
#17

Hello,

I have the same problem now.

Jeroen, could you change my uploaded translation to valid type too? I have just uploaded a firefox 3.0 gettext, you can see in my queue.

Regards,

Revision history for this message
Jeroen T. Vermeulen (jtv) said :
#18

Tran Vinh Tan: I see the gettext file in the queue, but where is the XPI file you want to upload?