Posted by jackdaw on January 25, 2007 at 4:09pm
Jump to:
| Project: | Drupal core |
| Version: | 5.2 |
| Component: | locale.module |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| errormessage.JPG | 21.39 KB | Ignored: Check issue status. | None | None |
Comments
#1
Ok, 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:
#: modules/comment/comment.module:314msgid "1 new comment"
msgid_plural "@count new comments"
msgstr[0] "1 ny kommentar"
msgstr[1] "%count nya kommentarer"
But when importing and exporting the same strings with Faroese translation, the last msgstrs get dropped
Imported:
#: modules/comment/comment.module:314msgid "1 new comment"
msgid_plural "@count new comments"
msgstr[0] "1 nýggj viðmerking"
msgstr[1] "@count nýggjar viðmerkingar"
Exported:
#: modules/comment/comment.module:314msgid "1 new comment"
msgid_plural "@count new comments"
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"
#2
Can 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.
#3
yes and yes, if you want it :-)
#4
Please look at http://drupal.org/node/108541
It's possible here the same bug.
#5
I've had a look at the PO files and they were missing a trailing ; in the plural formula.
Drupal should probably give a warning.
#6
Yes thank you, the last semicolon was the culprit, and now export works fine.
#7
It 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.
#8
I 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.
#9
my problem was plural strings:
read here for more info:
http://drupal.org/node/17564
#10
No activity, Closed
#11
I'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.