I exported my translations using i10n export as .po, but when i want to import it to localize.drupal.org i receive this error :

The translation file fa.po contains an error: "msgstr" was expected but not found on line 13691. 

The line contains this , the first link is line number "13691" (There are dozens of lines similar to this) :

#:   includes/theme.inc:1047 modules/user/user.module:628
msgid "View user profile."
msgstr "نمایش پروفایل کاربر"

Do you have any idea what's wrong with it.

CommentFileSizeAuthor
#7 modules-blog.fa_.po526 bytessinasalek

Comments

gábor hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

I'm more interested in the **line before**. The reason it is expecting an msgstr instead of an msgid is that it did not have an msgstr for the previous msgid for some reason. What's before this?

sinasalek’s picture

Now with few lines before and after :)
What is msgid_plural!

#:   modules/statistics/statistics.module:92
msgid "1 read"
msgid_plural "@count reads"

#:   includes/theme.inc:1047 modules/user/user.module:628
msgid "View user profile."
msgstr "نمایش پروفایل کاربر"

#:   themes/engines/phptemplate/phptemplate.engine:288;312
msgid "Submitted by !a on @b."
msgstr "ارسال شده توسط !a در @b."
gábor hojtsy’s picture

Yes, the problem here, is that you should actually have had at least two msgstr lines after the msgid_plural you have in this output. So you've exported this from Drupal's built in export feature (Administer » Site building » Translate » Export)?

sinasalek’s picture

Yes

gábor hojtsy’s picture

This sounds like you have a broken plural formula in the locale database. You can fix this by importing a .po file. You can just import a .po file with a header only (with the right plural formula) and that would fix it for Drupal.

sinasalek’s picture

StatusFileSize
new526 bytes
gábor hojtsy’s picture

Yes, the timeout is a known issue (and we have an localize.drupal.org issue open about it). Look back later whether the .po was actually imported. The proxy server that is sitting inbetween you and the webserver sometimes times out, but that does not mean PHP did not run all through with the import.

sinasalek’s picture

I see, What will happen if i import a same po file more that once?

arhak’s picture

@#9 I think there is no problem at all

do you intend to repeat the process several times?
export then re-import the .po file(s)

If you're re-importing several .po files consider that I have a custom module which provides re-import functionality
meaning that you overwrite all the translations with updated versions and it provides a link to re-run the import's batch

do you want me to mail it to you?

sinasalek’s picture

Actually i meant re-importing it into localize.drupal.org, I want to know, if i import it as suggestions , approve some of this translations and then re-import it again what will happen. Does it ignore already imported and approved strings? or import the whole thing again?
.po file contains few thousands strings, and its impossible for administration team to review all this strings more than once.

Thanks for the suggestion @arhak , Can your module help me in this process ?

arhak’s picture

@#11 no, no, haven't played around with l10n_server

nice use case you have there, I'll comment you via mail

gábor hojtsy’s picture

@sinsalek: (1) if you are an admin, you can directly submit translations without them being suggestions first; saves that extra approval step (which can be rather tedious with thousands of strings).

(2) if you import a .po file and the imported string is either an active (outstanding) suggestion or the existing translation itself, it is not being saved again; if it is not the same as the active translation or any of the outstanding suggestions though (even if it was a previously declined suggestion), it will be imported as a suggestion / translation

In general, it better to wait for the import to end properly (see notes above), instead of trying to reimport. The imports take too long because of the server load, and reimporting just puts in even more load.

sinasalek’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.