-
Notifications
You must be signed in to change notification settings - Fork 2
Localization
Craftinomicon has two phrases that require special treatment to get the pluralization right. In English, the phrases are ${num-recipes} recipe(s) (Left-click) and ${num-usages} usage(s) (Right-click). Of course, in the game they don't look exactly like this. For the recipes case, they look in the game like this:
![]()
![]()
i.e. whenever the number is 1, it says recipe, but for all other numbers, it says recipes. How does it know? The trick is that there are actually two translations for the recipes case (and two more for the usages case). They are defined like this:
recipe-click.num-recipes#one = ${num-recipes} recipe (Left-click)
recipe-click.num-recipes#other = ${num-recipes} recipes (Left-click)
The English translations for #two, #few, and #many are ignored by the game, because English has only singular and plural. Other languages need to translate a different set. For instance, in Chinese, there is no difference between singular and plural, so the Chinese translation only needs the #other case.
recipe-click.num-recipes#other = ${num-recipes} 说明书 (左键)
Russian, on the other hand, needs three translations for each phrase:
recipe-click.num-recipes#one - used when the number of recipes is 1 or 21 or 31 or 41, etc.
recipe-click.num-recipes#few - used when the number of recipes is 2, 3, 4, 22, 23, 24, 32, 33, 34, etc.
recipe-click.num-recipes#many - used when the number of recipes is 5-20, 25-30, 35-40, etc.
The rules for each language are defined in the Unicode CLDR.
Or you can look at the chart below:
| Language | Variant | Numbers |
|---|---|---|
| Chinese | #other | 1, 2, 3, 4, 5, ... |
| English | #one | 1 |
| #other | 2, 3, 4, 5, ... | |
| French | #one | 1 |
| #other | 2, 3, 4, 5, ... | |
| German | #one | 1 |
| #other | 2, 3, 4, 5, ... | |
| Italian | #one | 1 |
| #other | 2, 3, 4, 5, ... | |
| Japanese | #other | 1, 2, 3, 4, 5, ... |
| Korean | #other | 1, 2, 3, 4, 5, ... |
| Polish | #one | 1 |
| #few | 2-4, 22-24, 32-34, ... | |
| #many | 5-21, 25-31, 35-41, ... | |
| Portuguese | #one | 1 |
| #other | 2, 3, 4, 5, ... | |
| Russian | #one | 1, 21, 31, 41, ... |
| #few | 2-4, 22-24, 32-34, ... | |
| #many | 5-20, 25-30, 35-40, ... | |
| Spanish | #one | 1 |
| #other | 2, 3, 4, 5, ... |
If you'd like to translate a language not on the bukkit website, consult the Unicode CLDR to know what #one, #two, #few, #many, and #other mean for your language, and then submit your translation of all or some of the phrases, either by creating a git issue, or by sending an e-mail to JoshBBall@gmail.com.