Skip to content
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

Add support for proper plural translation #1269

Merged
merged 6 commits into from
Nov 10, 2024

Conversation

HenryLoenwind
Copy link
Contributor

@HenryLoenwind HenryLoenwind commented Jul 9, 2024

using the ICU plural format. This does not use full MessageFormats, just the number part in isolation. Embed them with "%()" in the language file, e.g. "mymod.dogs": "There %n(one{is # dog} other{are # dogs}) here.", This would be equivalent to a message format of "There {0,plural, one{is # dog} other{are # dogs}} here,".

See also: https://unicode-org.github.io/icu-docs/apidoc/dev/icu4j/com/ibm/icu/text/PluralFormat.html and https://www.unicode.org/cldr/charts/45/supplemental/language_plural_rules.html

using the ICU plural format. This does not use full Messageformats, just the number part. Embed them with "%()" in the language file, e.g. "dogs": "There %(one{is # dog} other{are # dogs}) here."

See also: https://unicode-org.github.io/icu-docs/apidoc/dev/icu4j/com/ibm/icu/text/PluralFormat.html and https://www.unicode.org/cldr/charts/45/supplemental/language_plural_rules.html
@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

which is actually invalid for vanilla and not just ignored
@HenryLoenwind HenryLoenwind marked this pull request as ready for review July 9, 2024 16:49
@Matyrobbrt Matyrobbrt added 1.21 Targeted at Minecraft 1.21 enhancement New (or improvement to existing) feature or request labels Jul 10, 2024
@HenryLoenwind HenryLoenwind changed the title [RFC] Add support for proper plural translation Add support for proper plural translation Jul 13, 2024
@TelepathicGrunt TelepathicGrunt merged commit e7f15f9 into neoforged:1.21.x Nov 10, 2024
6 checks passed
@TelepathicGrunt
Copy link
Contributor

When you can, could you add documentation of this plural translation system to the neo docs?
https://github.com/neoforged/Documentation

Not sure where in the docs it will fit but would be good to add it so people know the new system exists

@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.3.21-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21 Targeted at Minecraft 1.21 enhancement New (or improvement to existing) feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants