Rosetta upload fails with LanguageNotFound because pofile name is not a language name

Bug #2890 reported by Cedric L'homme
6
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Carlos Perelló Marín

Bug Description

"The file you uploaded was not recognised as a file that can be imported."

$ file pysubmind-doc-fr.po
pysubmind-doc-fr.po: UTF-8 Unicode English text, with very long lines

Maybe something wrong with very long lines ?

And if i put all in a tar :

$ tar -tf doc.tar
pysubmind-doc.pot
pysubmind-doc-fr.po

and upload it : "Oops please report the bug"

So ?
Can i attache the tar somewhere ?

Thank you

Revision history for this message
Cedric L'homme (rangzen) wrote : The space tar

I found where attach it :)

Revision history for this message
Christian Reis (kiko) wrote : Re: Unable to import a po file or a tar with this po file

To what potemplate name are you uploading this file? I only see the pysubmind template name, and this upload seems to be for a different name -- pysubmind-doc --(and domain) that that one.

Revision history for this message
Cedric L'homme (rangzen) wrote :

Is there a special way to name the files ?
The user list said that i can upload different potemplate.

Revision history for this message
Christian Reis (kiko) wrote :

The error I get when running this locally is:

    * Module canonical.launchpad.browser.potemplate, line 144, in submitForm
      self.upload()
    * Module canonical.launchpad.browser.potemplate, line 192, in upload
      self.status_message = tarball.do_import(
    * Module canonical.launchpad.helpers, line 273, in do_import
      pofile = potemplate.getOrCreatePOFile(code, variant, importer)
    * Module canonical.launchpad.database.potemplate, line 393, in getOrCreatePOFile
      raise LanguageNotFound(language_code)

LanguageNotFound: pysubmind-doc-fr

Revision history for this message
Christian Reis (kiko) wrote :

Cedric, to work around this issue, just rename the file pysubmind-doc-fr.po to fr.po.

Revision history for this message
Cedric L'homme (rangzen) wrote :

ok, so 1 tar with all the po named by langage per potemplate ...
Thank you !

Revision history for this message
Carlos Perelló Marín (carlos) wrote :

Right, that's the problem.

I'm working on a way that we don't need to do those renames but in the mean time, the only way to know the language that a pofile has is with its name.

Cheers.

Revision history for this message
Carlos Perelló Marín (carlos) wrote :

Ok, the error with the tarball should be more informative...

Will look into it.

Changed in rosetta:
status: New → Rejected
assignee: nobody → carlos
status: Rejected → Accepted
Revision history for this message
Cedric L'homme (rangzen) wrote :

Argh ... Now the pot overwrite eachothers ...
I import pysubmind.pot : ok ~80 messages
I import pysubmind-doc.pot : ~150 messages BUT no more msgid from pysubmind.pot
I import pysubmind.pot : ~80 messages and no more msgid from pysubmind-doc.pot
Do i have to open a new bug ?
Do i make mistakes again ?

Revision history for this message
Carlos Perelló Marín (carlos) wrote :

Yeah, you cannot upload two different .pot files to the same template, those are different and it's normal that one overwrites the other.

You have two different translations domains, you need to request the initial upload for the -doc one as you requested the initial upload for the 'pysubmind' after that, you will have two different templates to translate.

Please, refer to https://wiki.ubuntu.com/RosettaFAQ if you don't know how to request a new template import. After the initial upload, you will be able to request new uploads directly using the web.

Cheers.

Revision history for this message
Cedric L'homme (rangzen) wrote :

ok, sorry again and thanks again ...

Revision history for this message
Carlos Perelló Marín (carlos) wrote :

We changed the way we handle uploads and this is not happening again...

Changed in rosetta:
status: Confirmed → Fix Released
Revision history for this message
Cedric L'homme (rangzen) wrote :

Do i have to upload again to test this one ?
https://launchpad.net/products/rosetta/+bug/29286

Revision history for this message
Carlos Perelló Marín (carlos) wrote :

Well, I don't think it will happen again as we only check that it ends with .po or .pot but it's a good idea to check it just in case there is something weird going with the change.

than you.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.