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

[CLDR v38+] Support / handle unit inflections #67

Open
movermeyer opened this issue Aug 27, 2021 · 0 comments
Open

[CLDR v38+] Support / handle unit inflections #67

movermeyer opened this issue Aug 27, 2021 · 0 comments

Comments

@movermeyer
Copy link
Collaborator

movermeyer commented Aug 27, 2021

This PR added inflections to units, so entries in the data changed from:

<unit type="duration-day">
  <displayName>Tage</displayName>
  <unitPattern count="one">{0} Tag</unitPattern>
  <unitPattern count="other">{0} Tage</unitPattern>
  <perUnitPattern>{0} pro Tag</perUnitPattern>
</unit>

to

<unit type="duration-day">
  <gender>masculine</gender>
  <displayName>Tage</displayName>
  <unitPattern count="one">{0} Tag</unitPattern>
  <unitPattern count="one" case="accusative">{0} Tag</unitPattern>
  <unitPattern count="one" case="dative">{0} Tag</unitPattern>
  <unitPattern count="one" case="genitive">{0} Tages</unitPattern>
  <unitPattern count="other">{0} Tage</unitPattern>
  <unitPattern count="other" case="accusative">{0} Tage</unitPattern>
  <unitPattern count="other" case="dative">{0} Tagen</unitPattern>
  <unitPattern count="other" case="genitive">{0} Tage</unitPattern>
  <perUnitPattern>{0} pro Tag</perUnitPattern>
</unit>

Notably, there are now multiple values for each of the count attributes (one for each case). Previously, there was only the "nominative" case.

Using ruby-cldr with v38 gives a different behaviour than it did with v37, since this code returns whatever case happens to appear last in the file (in this case "genitive" in v38, "accusative" in v37).


As a first step, we should change the code to return the "nominative" case.
Longer term, we can look into ways to expose the other cases.

@movermeyer movermeyer changed the title [CLDR v38+] Add support / handle unit inflections [CLDR v38+] Support / handle unit inflections Apr 21, 2022
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

No branches or pull requests

1 participant