Engine support for ngettext #21
Conversation
Added support for translation with correct plural forms to engine.
|
Hi, Thank you for the pull request. Unfortunately, there are some problems need to tackle before merging it:
|
|
I have compared the rules for our current locales from http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html with the list in We should make another pass with the plural headers shipped from Transifex just to be sure, but I don't have access to them at this point - we might actually need to update Transifex with the new |
|
I have checked the link you have provided, and it looks like that there are some plural forms not included in the predefined list of BTW I have filled a issue on
Anyway As for the return value type of |
|
BTW, the de and gd translation files in the master branch are already from Transifex and they have the correct plural headers. On the other hand some existing old translations doesn't have correct plural headers, for example ru translation. |
|
Did you keep a list of the missing plural forms by any chance? I'd be willing to do the work if we have a list. Irish (ga) is there, but outdated. I double-checked with the CLDR, which is the authoritative resource. They have changed the format from 3 to 5 entries. This can sometimes happen when rules get refined. Ping me when you have pushed & pulled with Transifex, then I'll have another look to make sure that all the formulas are up to date. We will then need to keep an eye out when adding new locales. Transifex are good about sending e-mails around when they do anything to their plural implementation, so we're safe if they should change anything in the future. |
|
I have already implemented an expression parser Usually I only push source & zh_CN translation to Transifex, and pull translations other languages. |
The
The translations currently we have without plural forms are: es, fi, fr, it, nl, ru (which has wrong plural forms). |
|
I have had a quick look at the parser - I think we should drop support for bitwise operators. They can only be illegal in plural form expressions.
Yes, so you need to push the .pot to Transifex, then pull the translations. You should get updated headers then. |
OK, I have checked the official GNU Gettext implementation http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/plural.y#n132 http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/plural-exp.h#n34, and they doesn't support bitwise operators as well. So I'll remove the bitwise operators.
I see. I only pull the translations which currently is translating on Transifex. I will pull all the translations later before the next beta version (or RC version) is released. |
|
You still need to run the pot update tool - I neglected to do so to keep the diff for my PR small. Then you will need to push the new version to Transifex. Alternatively, you can set up Transifex to automatically pull any pot updates from https://github.com/acmepjz/meandmyshadow/raw/master/data/locale/messages.pot This is where you will find the autoupdate function: |
|
I have updated the pot locally, but not yet pushed onto Github nor Transifex. I'll do it now. |
Added support for translation with correct plural forms to engine.
Some notes:
messages.pot.shto keep the diff small.