translate / virtaal

Easy-to-use and powerful offline translation tool
https://virtaal.translatehouse.org
GNU General Public License v2.0
300 stars 58 forks source link

Support for configuring "Plural-Forms" #3212

Open fbobraga opened 9 years ago

fbobraga commented 9 years ago

I'm using this tool to translate PO files to Brazilian Portuguese (pt_BR) - but the header of the translated files become:

"[...] Plural-Forms: nplurals=2; plural=(n != 1); [...]"

... from the correct (as noted in http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html), already in the files, value:

"[...] Plural-Forms: nplurals=2; plural=(n > 1); [...]"

Since the Virtaal tool seems to don't have the configuration for it (or I can't find it!), like in http://poedit.net/ (for example), how can I configure it to correctly handle the Plural-Forms info in the header of translated files? Is necessary to alter some setting in ~/.virtaal/virtaal.ini? In my virtaal.ini:

"[...] [language] [...] targetlang = pt_BR [...] plural = None [...]"

  • I'm using the 0.7.1 version of the tool
fbobraga commented 9 years ago

I've tried to change my ~/.virtaal/virtaal.ini to:

"[...] [language] [...] plural = nplurals=2; plural=(n > 1); [...]"

... but it seems to have no effect (the value is not changed in the config file, but the behavior is the same) - I've tested it with the version in the Debian repo (0.7.1) and clonning the git (version "1.0.0-beta"), with the same results

rffontenelle commented 9 years ago

After a extensive search, I found that the error is in the repository 'translate', more specifically in translate/lang/data.py, which wrongly defines plural-form: 'pt_BR': (u'Portuguese (Brazil)', 2, '(n != 1)'),

It can be seen in https://github.com/translate/translate/blob/master/translate/lang/data.py

rffontenelle commented 9 years ago

I created a Pull Request in translate repository to fix this issue. You can view it in https://github.com/translate/translate/pull/3261

fbobraga commented 9 years ago

moved to https://github.com/translate/translate/issues/3263

unho commented 9 years ago

@fbobraga These differences should be filed as an issue in https://github.com/translate/translate/issues

kwenzig commented 9 years ago

Ich kehre zurück am 04.05.2015.

Dann werde ich mich um das Anliegen kümmern. Beste Grüße Knut Wenzig

Hinweis: Dies ist eine automatische Antwort auf Ihre Nachricht "Re: [virtaal] Support for configuring "Plural-Forms" (#3212)" gesendet am 04/24/2015 19:36:07.

Diese ist die einzige Benachrichtigung, die Sie empfangen werden, während diese Person abwesend ist.

beernarrd commented 9 years ago

It affects also slovenian, where two "Plural-Forms" exist and it happens that some files use one string and other use the other one. Proposition: an already existing Plural-Forms string should not be changed (without warning).