-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Plural-Forms
for Brazilian Portuguese
#67
Comments
did you try notice |
Yes,
|
Sorry, I linked to the wrong file. I suspect the issues is here i18next-gettext-converter/src/lib/json2gettext.js Lines 42 to 53 in 7ece5fc
|
right should convert but https://github.com/i18next/i18next-gettext-converter/blob/master/src/lib/plurals.js#L489 the rule taken is looking at http://www.unicode.org/cldr/charts/29/supplemental/language_plural_rules.html#pt i guess the rule |
but looking at: http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html plural rules for portugues and portugues in brasil are different... as i speak neither i'm not sure which source is right |
http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html was my reference source also. Our Brazilian translators gave us a PO file with A quick google seems to confirm it here https://doc.qt.io/archives/qq/qq19-plurals.html
So I think your info in https://github.com/i18next/i18next-gettext-converter/blob/master/src/lib/plurals.js is correct, it is just the split on pt: {
name: 'Portuguese',
nplurals: 2,
plurals: '(n != 1)',
},
pt_br: {
name: 'Brazilian Portuguese',
nplurals: 2,
plurals: '(n > 1)',
}, Thanks for your quick reply 👍 |
honestly wasn't aware that regional locals of a language even goes on changing the pluralforms - that's the reason why - even the CLDR which is the base of most localization tools does not differ there. @perrin4869 a solution would be to test first if a rule exists for a full match eg. |
ok seems http://www.unicode.org/cldr/charts/26/supplemental/language_plural_rules.html new default is now pt = pt-BR and a special treatment for pt-PT ;) does it make sense...? Think i need to update this on i18next as well...:( |
I can try and check with the translator we used. I don't speak the languages, so can't say. I too didn't realise the extent of regional variations until this bug came in. |
rather sure http://www.unicode.org/cldr/charts/26/supplemental/language_plural_rules.html is right...it should be n > 1 for pt-BR |
made the needed change to i18next and published an update: i18next/i18next@c5113fb |
Thanks for your hard work. I guess a similar change will be needed here too?
|
right...i hope @perrin4869 will do this change in the next days.... |
Thanks again. If needed I could look at proposing a Pull Request based on your |
@rankida if you send a PR, I can review it on Sunday. It would be highly appreciated |
No problem @perrin4869 I will give it a go. One question - @jamuhl's change i18next/i18next@c5113fb moves European Portuguese ( Would you like me to keep it inline with |
@rankida i think / believe / guess unicode docs are wider used...that's why i decided on using their favour ;) |
Let me know if #68 needs fixedup @perrin4869 |
Merged and published as |
Hi. Thanks for this great tools!
I have encountered an issue when trying to generate a PO file for Brazilian Portugal. This may be user, error, but this is what I see:
I run
where
hello.json
is nothing more than{ "Hello": "Olá" }
and I get a PO file withThe issue is that for Brazillian Portuguese it should be
nplurals=( n > 1)
, and it is correct inplurals.json
here https://github.com/i18next/i18next-gettext-converter/blob/master/src/lib/plurals.js#L494-L498I have tried using
pt-BR
orpt-br
but they both give me the regular Portuguese plural forms.I suspect the problem is down to this line
i18next-gettext-converter/src/lib/gettext2json.js
Line 134 in 7ece5fc
The text was updated successfully, but these errors were encountered: