Closed (fixed)
Project:
Drupal core
Version:
5.2
Component:
locale.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2007 at 16:09 UTC
Updated:
30 Dec 2010 at 13:30 UTC
Quoting the attached poEdit error message:
Couldn't load file C:\fo.po, it is probably corrupted.
Broken catalog file: singular form msgstr used together with msgid_plural
Opening the fo.po with WordPad, and searching for 'msgid_plural', I see that the translations are missing, for instance with:
#: modules/aggregator/aggregator.module:986, ;997;1406
msgid "1 item"
msgid_plural "@count items"I have tried to search the po-file for the relevant translation strings, but they are not there.
| Comment | File | Size | Author |
|---|---|---|---|
| errormessage.JPG | 21.39 KB | jackdaw |
Comments
Comment #1
jackdaw commentedOk, I tried to import another language (Swedish), and export worked fine. So it seems that there is something wrong with my Faroese translation file, or maybe with how Drupal handles special Faroese (/Icelandic) letters like ð and á.
For example, Drupal manages to import and export the following strings without error:
But when importing and exporting the same strings with Faroese translation, the last msgstrs get dropped
Imported:
Exported:
This happens every time when there is an msgid_plural: The following translated msgstrs get dropped.
I think the import part works fine though, as I can see the translated eg "2 new comments" -> "2 nýggjar viðmerkingar"
Comment #2
killes@www.drop.org commentedCan you mail me your faroese translation to test with? Also: Are you going to contribute the translation? Use the contact from to get my mail address.
Comment #3
jackdaw commentedyes and yes, if you want it :-)
Comment #4
maynich commentedPlease look at http://drupal.org/node/108541
It's possible here the same bug.
Comment #5
gerhard killesreiter commentedI've had a look at the PO files and they were missing a trailing ; in the plural formula.
Drupal should probably give a warning.
Comment #6
jackdaw commentedYes thank you, the last semicolon was the culprit, and now export works fine.
Comment #7
Wesley Tanaka commentedIt looks from the 5.1 code that the only way that this output is possible (the msgid_plural line is printed but no msgstr[] lines are printed) is if the plurals column in the database for the given language is 0 (I don't know if such a column value is possible in a clean install of 5.1 -- I came to this bug via a 4.7->5.1 upgrade.
Isn't the absolute minimum number of plural forms in a language 1 by definition? I'm planning on updating my database manually, but it seems like there *is* a bug here, in that
the output of msgid_plural is guarded on $parent[$message['plural']]
while the output of the msgstr lines is guarded on $meta->plurals
Since it's possible the two values are different, corrupt .po files can be generated. The branch guards for both should be based on the same piece of data.
Comment #8
holydrupal commentedI have the same problem!
after I added several module and I translated those modules to Persian, now my exported translation couldn't be open in Poedit :(
and all the words are:
Œ باشد. بزودی سایت با مط
This is not Persian word!
I checked the encoding and it was UTF-8, there was no problem with encoding.
and when I couldn't import it to Drupal too!!!!
what have been happened?
any idea?
I didn't had these kind of issues before.
Comment #9
holydrupal commentedmy problem was plural strings:
read here for more info:
http://drupal.org/node/17564
Comment #10
ricabrantes commentedNo activity, Closed
Comment #11
adr_p commentedI've just faced the same problem: exported *.po file (via admin/build/translate/export) was broken (therefor couldn't be imported back) because there were no msgstr entries (not even empty ones) after any of the msgid_plural records.
This was caused by improper (NULL) values for plural and formula columns in {languages} db table.
The solution is to fill language record with the proper data. You can find it e.g. under the link mentioned above: http://drupal.org/node/17564
My Drupal version was 6.17.
I hope someone will find this note useful.