Skip to content

fix(hr-HR): feminine number words before -arda scale words#414

Open
greymoth-jp wants to merge 1 commit into
forzagreen:mainfrom
greymoth-jp:fix/hr-HR-arda-feminine
Open

fix(hr-HR): feminine number words before -arda scale words#414
greymoth-jp wants to merge 1 commit into
forzagreen:mainfrom
greymoth-jp:fix/hr-HR-arda-feminine

Conversation

@greymoth-jp

Copy link
Copy Markdown
Contributor

In Croatian the scale nouns alternate gender: tisuća (10^3), milijarda (10^9), bilijarda (10^15) and the higher -arda words are feminine, while milijun (10^6), bilijun (10^12) and the -un words are masculine. The count in front of a feminine scale word has to agree, so one billion is "jedna milijarda" and two billion is "dvije milijarde".

hr-HR only treated thousands as feminine (isFeminine = scaleIndex === 1), so every -arda scale above thousands printed the masculine count:

  • 1_000_000_000 gave "jedan milijarda" (should be "jedna milijarda")
  • 2_000_000_000 gave "dva milijarde" (should be "dvije milijarde")
  • 1e15 gave "jedan bilijarda" (should be "jedna bilijarda")

milijun and the other -un scales were already correct and stay unchanged (1_000_000 -> "jedan milijun").

Fix

Change the gender test to scaleIndex % 2 === 1, which is feminine at every -arda scale and masculine at the -un scales, in both the cardinal and ordinal builders. This is the same change #413 made for sr-Cyrl-RS and sr-Latn-RS; Croatian shares the Serbo-Croatian milijarda-is-feminine grammar, and the file's existing feminine machinery (ONES_FEM / buildSegmentFem, already used for tisuća) handles it.

Added cardinal cases (milijarda, bilijarda) and ordinal cases (milijarditi) to test/fixtures/hr-HR.js. npm test and npm run lint pass; reverting only the source change makes the new cardinal case fail with "jedan milijarda" vs "jedna milijarda".

Croatian milijarda and bilijarda, and the higher -arda scale words, are
feminine like tisuća, so the count in front of them takes the feminine
form: jedna milijarda, dvije milijarde, not jedan milijarda. Only
thousands were marked feminine, so every -arda scale (10^9, 10^15, ...)
printed the masculine count.

Change the gender test from scaleIndex === 1 to scaleIndex % 2 === 1,
feminine at each -arda scale and masculine at the -un scales (milijun,
bilijun, ...), in both the cardinal and ordinal builders. This is the
same fix forzagreen#413 made for sr-Cyrl-RS and sr-Latn-RS, which share this
grammar. Adds cardinal and ordinal cases for milijarda and bilijarda.
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