Skip to content

Register Macedonian plural rule under mk and fix 111, 211, ... - #538

Open
vtxe02023274 wants to merge 1 commit into
axuno:mainfrom
vtxe02023274:fix/macedonian-plural-rule
Open

vtxe02023274 wants to merge 1 commit into
axuno:mainfrom
vtxe02023274:fix/macedonian-plural-rule

Conversation

@vtxe02023274

Copy link
Copy Markdown

Macedonian is registered under "mb", which is not an ISO 639-1 code. CultureInfo("mk").TwoLetterISOLanguageName is mk, so plural formatting with mk or mk-MK throws:

IsoLangToDelegate not found for mk (Parameter 'twoLetterIsoLanguageName')

The Macedonian rule also compared the whole value with 11 (value != 11), so 111, 211, 311, ... resolved to one. CLDR has one for i % 10 = 1 and i % 100 != 11 (1, 21, 101 are one; 11, 111, 211 are other), the same as Intl.PluralRules("mk").

Changes:

  • Register the rule under mk
  • Use value % 100 != 11 in the rule

Test_Macedonian covers mk and mk-MK, with both a culture provider and plural(mk). Before the change both cases throw; with only the key fixed they fail on 111. Both pass now.

Full test run: 1,037 passed on net6.0 and 1,032 on net462. The two remaining failures (Explicit_Formatter_With_Not_Enough_Parameters_Should_Throw and Pluralization_With_Changed_SplitChar) depend on the UI culture of this machine and fail the same way on unchanged main.

Macedonian was registered under "mb", which is not an ISO 639-1 code, so plural formatting with mk or mk-MK cultures threw "IsoLangToDelegate not found for mk".

The rule also compared the whole value with 11, so 111, 211, ... resolved to one. CLDR uses i % 10 = 1 and i % 100 != 11 for one.
@vtxe02023274

Copy link
Copy Markdown
Author

AppVeyor failure is unrelated to this change: the unpinned dotnet add package AltCover now resolves 9.0.189 (published Nov 18), whose MSBuild task is built for net10.0 and fails to load on the image (MSB4062, System.Runtime 10.0.0.0). The solution builds fine before that step. Pinning AltCover to 9.0.145 or adding the .NET 10 SDK to the image should fix it

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