How to Translate with Plural
-
Hi, I read this before ask here. But I have different constraints. What can I do?

Thanks,
-
This topic was modified 8 years, 3 months ago by
Dimitri Zhenya.
-
This topic was modified 8 years, 3 months ago by
-
Hi there. Thanks for this.
It seems that WordPress and Unicode disagree on the plural forms for Indonesian.
According to Unicode CLDR Indonesian has no plualization (having just a single form “other” like Chinese/Japanese). These are the rules that Loco Translate uses.
I see now though, that the WordPress core translations for Indonesian use germanic plurals (one,other). Is this what you know to be correct?
There is currently no fix for this, but if I can be sure that [one,other] is correct for Indonesian I’ll change this in the next version of the plugin.
In the mean time I’ll add a filter into the development version so you can modify/customize the plurals using some code. I’ll post back when I’ve done that.
The development branch (2.1.0-dev) has a new filter (loco_locale_plurals) that allows you to change plural rules by manipulating the raw locale data.
The following code will alter Indonesian to use the same plurals as you’ll find in the WordPress core files. (This rule is the same as French, for example).
function fix_indonesian_plurals( array $data, Loco_Locale $locale ){ if( 'id' === $locale->lang ){ $data[0] = 'n > 1'; $data[1] = array('one','other'); } return $data; } add_filter( 'loco_locale_plurals', 'fix_indonesian_plurals', 10, 2 );I may fix the built-in rules for Indonesian, but first I need to know for certain what they should be.
Yes, Indonesian same with German plurals (one, other)
German is like English
(n != 1)whereas WordPress (GlotPress) uses(n > 1)for Indonesian (as with French).The difference in the equation will affect how your translations are displayed for different quantities. In English you’ll see the “one” form for only
1of something (like “1 Comment”) but in French you’ll see it for0and1.You see my problem of implementing rules that the authorities can’t seem to agree upon?
Wondering if @ekajogja can help here and confirm that the GlotPress plural rules are correct and Unicode CLDR is wrong.
Unicode CLDR is correct.
The tab should be labeled plural instead of semua bidang which translates to all fields (You meant we should translate both obviously different fields into one field?).
More helpful title would be: plural (ignore single).
-
This reply was modified 8 years, 3 months ago by
Eka Y Saputra.
Thanks for the clarification. I shall leave the plugin data as it is.
Regarding the label: the source string is All forms. I won’t change the English, but the translation is there for anyone to improve it in their language.
I’m marking this as resolved because I’ve added a filter to allow plural rule customization.
I’ve also made a note to fix the editor to use plural rules defined by PO files if they differ from the internal rules.
-
This reply was modified 8 years, 3 months ago by
The topic ‘How to Translate with Plural’ is closed to new replies.