as per subject :)

Comments

KirstenLangholz’s picture

Having the same problem here - any help?!

salvis’s picture

In what context do you have this problem?

We have

"Plural-Forms: nplurals=2; plural=(n != 1);\n"

http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html does not show the parentheses, but I've never seen problems with this. OTOH, I haven't seen the plural feature being used in the German translation either...

BTW, the formula in the French translation is different, but it also has the parentheses.

tjt756’s picture

I'm having the same problem, if anyone figures this out please let us know. For me it happened when i installed the translation overview module and localization client module. i already had i18n installed and enabled.

Thanks,
TJ

salvis’s picture

So, which one is it, translation overview module or localization client module?

KirstenLangholz’s picture

Okay,

I set up the the website with the German language file already in it from drupal.de. All worked fine. Then I addes quite some modules and exported the de.po file and opened it in Poedit. I translated the missing strings.
At one point, I assume there was a plural form hidden, Poedit showed me an error message each time I tried to safe the de.po file on my hdd.
I opened it in notebook and fount out that the plural option was missing. I checked some of the module translations and found the following plural formula that I then added to the de.po file so that it looks like this in the end:

msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2009-05-24 20:40+0200\n"
"PO-Revision-Date: 2009-05-24 20:40+0200\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

The I turned

#:  comment_notify.module:535
msgid "Email unsubscribed from 1 comment notification."
msgid_plural "Email unsubscribed from @count comment notifications."

into

#:  comment_notify.module:535
msgid "Email unsubscribed from 1 comment notification."
msgid_plural "Email unsubscribed from @count comment notifications."
msgstr[0] ""
msgstr[1] ""

and translated them with notebook and saved it. Then I could work with Poedit again without any errors. But each time one msgid_plural is added and not handled as described above, the error message shows up again and the translated de.po cannot be imported anymore.

I hope this explains it better to those who can help.

kkaefer’s picture

drupal.de is not a site associated with the Drupal project or the German translation.

KirstenLangholz’s picture

Okay, set up the original Drupal 6.12 here from the site integrated German from within, added modules, exported de.po file worked on it and same error ... so now?!

salvis’s picture

@KirstenLangholz: Your plural form in #5 is definitely wrong. INTEGER and EXPRESSION need to be replace with the language-specific values.

See #2 above.

Abilnet’s picture

I'm facing the same error when adding more languages at:

admin/settings/language/add

So far, adding other languages seems to work without errors, but when adding German, I'll get:
The translation file de.po contains an error: the plural formula could not be parsed.

(I have a fresh, default D6.13 installation)

salvis’s picture

Abilnet: What's the Plural-Forms entry in you de.po file?

Abilnet’s picture

@salvis: I have no idea... I was just playing around to study how to configure a multilingual site, and happened to recognise the error in German language and decided to report. Sorry I can't help more (I'm not a coder)

kkaefer’s picture

Abilnet, can you please describe the steps you performed to install the German language pack? If you downloaded a specific file, please open the .po file and look at the Plural-forms: line in the header.

Abilnet’s picture

@kkaefer: Actually, I did not download anything. Just went through the steps mentioned above at #9

I was adding more languages at:
admin/settings/language/add

Other languages I tested, worked without any problems, but when adding German language, I got an error:
The translation file de.po contains an error: the plural formula could not be parsed.

EDIT:

For more testing, I deleted the German language at:
admin/settings/language

Then extracted the German language pack from Drupal.org

Then adding German again at:
admin/settings/language/add

Result: Exactly the same error:
The translation file de.po contains an error: the plural formula could not be parsed.

"de.po" at:
profiles/default/translations
is including:
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

hass’s picture

Category: bug » support
Status: Active » Fixed

I have never seen this issue with one of the core files. If a module *.de.po file is broken - simply configure the nplurals=2; plural=(n != 1); for the broken translation file and also commit a fixed version of the file to CVS for the next release of the module. Aside - finding the broken file is really hard with many modules... it's a good rule to name them [module].de.po... this really helps much to find the broken file.

salvis’s picture

Indeed, I just found de.po in Content Access 6.x-1.1 to be broken and produce that error: #369942: The translation file de.po contains an error: the plural formula could not be parsed.

If you have German activated and get this error when you enable a module, then it's obvious who's the culprit. However, if you have a site with many contrib modules installed, and one day you enable German and you get this error, then there's no way to know which de.po is causing the error.

Naming the translation files [module].de.po (as hass suggests) would surely help, but very few contrib modules do that; I didn't even know it was allowed. IMO, Drupal not including the full file path in the error message is a core bug that should be fixed...

Status: Fixed » Closed (fixed)

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

clashar’s picture

I have the same error now, when I tried to add German language to other languages.
i18n and other different modules were installed before.

It's strange that 1 year after previous posts the problem still exists.

transmitter’s picture

I ran into the same problem when using Aegir and putting an exported de.po file in my installation profile.

I double checked "Plural-Forms: nplurals=2; plural=(n != 1);\n" - that's correct and I can save the file with POedit.
Still .. I can't use my installation profile along with the German language.

Where else could the line:
The translation file de.po contains an error: the plural formula could not be parsed.
come from?

I only have one po file, exported from website A where I got all my features from that I want to use for a website B with the installation profile.

Thomas_Zahreddin’s picture

i recommend the use of

http://drupal.org/project/l10n_pconfig

then the plural formula from the imported file is ignored, and a reasonable default for most languages is set.

how to fix a broken file - is described in this issue.

(sorry jumping so late on this, just for documentation)

joachim namyslo’s picture

Issue summary: View changes