Posted by wpanssi on February 26, 2009 at 8:49pm
As I export a po file (finnish language) and then try to import it with out any modifications I get this error message:
The translation file xxx.po contains an error: "msgstr" was expected but not found on line xxx.
The translation import of xxx.po failed.
The error is somehow related to plurals because if I delete every line related to plurals importing works. But when I export the po file the plurals are there again and apparently something is wrong with them.
Any help highly appreciated! I have had this problem for over a half a year now, but I haven't got any suggestions. You can see my previous post on the same subject here: http://groups.drupal.org/node/13885
Comments
It might help if you told us
It might help if you told us exactly which xxx.po file it was and which "xxx" line it was, so that people can actually look for the error instead of guessing.
Of course, sorry about that
Of course, sorry about that (didn't think the file name is meaningless). The exact error is:
The translation file fi.po contains an error: "msgstr" was expected but not found on line 9905.
The translation import of fi.po failed.
Here's a clip from the fi.po file.
#: modules/comment/comment.module:304;436 modules/node/node.module:68
msgid "1 comment"
msgid_plural "@count comments"
[HERE IS LINE NUMBER 9905]#: modules/comment/comment.info:0
msgid "Allows users to comment on and discuss published content."
msgstr ""
"Mahdollistaa julkaistun sisällön kommentoinnin ja siitä "
"keskustelun."
So, the problem is that after msgid_plural there isn't any msgstr. Somehow when exporting the fi.po the plurals won't end up right. I'd guess the error occurs in the exporting process.
Oh, I see... I didn't realize
Oh, I see... I didn't realize that it was an export from a site and I was thinking of filenames of packaged translations.
If there is nothing unusual about your 2 msgstrings which were not exported, then it could be a bug. Does this happen with all plurals? I mean, if you fix this one does the ereor appear at the next plural?
If it happens only for some plurals try to find out what they have in common.
Yes, it happens with all
Yes, it happens with all plurals. If I fix one, I get the line number of the next plural..
It seems that it is a known
It seems that it is a known problem. Some quick googling for
drupal translation export po pluralsrevealed a very good writeuphttp://wtanaka.com/node/7630
and following the links I also found and issue and a documentation page
http://drupal.org/node/112712
http://drupal.org/node/17564