Skip to content

Update languages.csv#2486

Open
svenddpc wants to merge 4 commits into
WeblateOrg:mainfrom
svenddpc:patch-1
Open

Update languages.csv#2486
svenddpc wants to merge 4 commits into
WeblateOrg:mainfrom
svenddpc:patch-1

Conversation

@svenddpc

@svenddpc svenddpc commented Jun 4, 2026

Copy link
Copy Markdown

Added the full Te Reo Maori (mi) plural form formula, which allows for different translations for cases where n is greater than 10.

Added the full Te Reo Maori (mi) plural form formula, which allows for different translations for cases where n is greater than 10.
Comment thread languages.csv Outdated
mh,Marshallese,2,n != 1
mhr,Meadow Mari,2,n != 1
mi,Maori,2,n > 1
mi,Maori,3,n == 1 ? 0 : n < 10 ? 1 : 2;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking through my installation, to see if there was a place I could make a change to test this new fomat, I noticed in weblate/lang/data.py there are a bunch PLURAL_NAMES defined as sets of formats (e.g. ONE_OTHER_PLURALS which seems to be all the plural formats that have two values a "single" and a "plural" (or "one" and "other") which includes the old setting for Maori, as well as ONE_FEW_MANY_PLURALS, which I guess should include the new one. Since the new format I've added here doesn't match any of the existing ONE_FEW_MANY_PLURALS, does it need to be added somewhere else as well?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed another commit with changes in more places where it's defined (and removed the semi-colon from this entry). Didn't find the names though.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But those values might be generated based on some rules in the pluralRanges files, so maybe I don't need to make changes for that to work :) 🤞

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I need to add this tag to the TAG_MAP in export-plural-tags.py?

Removed semi-colon from languages.csv entry for Maori

@svenddpc svenddpc left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't mean to start a review - those should all just have been comments. Always do that :P

Comment thread languages.csv Outdated
mh,Marshallese,2,n != 1
mhr,Meadow Mari,2,n != 1
mi,Maori,2,n > 1
mi,Maori,3,n == 1 ? 0 : n < 10 ? 1 : 2;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed another commit with changes in more places where it's defined (and removed the semi-colon from this entry). Didn't find the names though.

Comment thread languages.csv Outdated
mh,Marshallese,2,n != 1
mhr,Meadow Mari,2,n != 1
mi,Maori,2,n > 1
mi,Maori,3,n == 1 ? 0 : n < 10 ? 1 : 2;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But those values might be generated based on some rules in the pluralRanges files, so maybe I don't need to make changes for that to work :) 🤞

Comment thread languages.csv Outdated
mh,Marshallese,2,n != 1
mhr,Meadow Mari,2,n != 1
mi,Maori,2,n > 1
mi,Maori,3,n == 1 ? 0 : n < 10 ? 1 : 2;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I need to add this tag to the TAG_MAP in export-plural-tags.py?

Comment thread PLURALS_DIFF.md
`mh` | Marshallese | nplurals=2; plural=n != 1; | | | |
`mhr` | Meadow Mari | nplurals=2; plural=n != 1; | | | |
`mi` | Maori | nplurals=3; plural=n == 1 ? 0 : n < 10 ? 1 : 2; | | | |
`mi` | Maori | nplurals=3; plural=n == 1 ? 0 : n < 10 ? 1 : 2; | | | nplurals=2; plural=(n > 1); |

@svenddpc svenddpc Jun 4, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit by the CI bot seems to be broken? Is that because I made my changes wrong?

Comment thread translate.csv
mfe,Morisyen,2,(n > 1)
mg,Malagasy,2,(n > 1)
mi,Maori,2,(n == 1 ? 0 : n < 10 ? 1 : 2)
mi,Maori,2,(n > 1)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And is this just undoing my change again? Since these changes are made by a CI bot, I presume that I've done something wrong, or I'm missing something for it to decide to undo my changes?

@svenddpc

Copy link
Copy Markdown
Author

I've now learned two things:

a) These settings are based on the Unicode project (CLDR), and changes probably won't be approved until they match that project's definitions(?).
b) The full plural definition variations equation might be even more complicated than Russian (for instance), where the form depends on the most significant digit (rather than the last) of the number, so someone might have to work out exactly what that is before it's meaningful to submit a request to the CLDR project for a change (and probably someone with more authority in Te Reo Maori than me).

Not sure if I should just close this PR? I've manage to just modify our local languages.py and plurals.py files in our Weblate installation, to allow for the three forms here, which works for the cases we need, and our localiser assures us that we can cover all translations with those forms, but just being clever with how things are localised. But I still think that could be useful for others who would like to add Te Reo Maori to their games/websites/apps/services, and could be using Weblate to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant