elixir-cldr / cldr_numbers

CLDR Number localisation and formatting
Other
41 stars 23 forks source link

RBNF Format digits-ordinal not available for German #22

Closed maennchen closed 3 years ago

maennchen commented 3 years ago

Versions

* cldr_utils 2.17.0-rc.0 (Hex package) (mix)
  locked at 2.17.0-rc.0 (cldr_utils) ccff70d7
* ex_cldr 2.24.0-rc.6 (Hex package) (mix)
  locked at 2.24.0-rc.6 (ex_cldr) a0023457
* ex_cldr_calendars 1.17.0-rc.3 (Hex package) (mix)
  locked at 1.17.0-rc.3 (ex_cldr_calendars) f6dbaf91
* ex_cldr_currencies 2.12.0-rc.1 (Hex package) (mix)
  locked at 2.12.0-rc.1 (ex_cldr_currencies) 3a48b2fa
* ex_cldr_dates_times 2.10.0-rc.3 (Hex package) (mix)
  locked at 2.10.0-rc.3 (ex_cldr_dates_times) 7900c65a
* ex_cldr_languages 0.3.0-rc.0 (Hex package) (mix)
  locked at 0.3.0-rc.0 (ex_cldr_languages) d2a0330b
* ex_cldr_lists 2.9.0-rc.2 (Hex package) (mix)
  locked at 2.9.0-rc.2 (ex_cldr_lists) 3964b376
* ex_cldr_numbers 2.23.0-rc.3 (Hex package) (mix)
  locked at 2.23.0-rc.3 (ex_cldr_numbers) eec42f46
* ex_cldr_units 3.8.0-rc.2 (Hex package) (mix)
  locked at 3.8.0-rc.2 (ex_cldr_units) e2a65a98

Code

HygeiaCldr.Number.to_string!(7, locale: "de", format: :digits_ordinal)

Expected

7.

Actual

** (Cldr.Rbnf.NoRule) Locale "de" does not define an rbnf ruleset :digits_ordinal
    (ex_cldr_numbers 2.23.0-rc.3) lib/cldr/number.ex:439: Cldr.Number.to_string!/3

CLDR Source

A default digits-ordinal ruleset is defined in root. (common/rbnf/root.xml)

Therefore german (that does not define a custom ruleset) should fall back to the root.

kipcole9 commented 3 years ago

Very interesting, thanks for the report and the associated detail.

In the upcoming CLDR 40 (upon which these RC ex_cldr and libs are based), the "root" locale is now "und" to be BCP47 compliant.

I need to check if this error is because of that change or some other issue.

Really appreciate you testing the RC, it really helps. I'll work on this now.

kipcole9 commented 3 years ago

I have published ex_cldr_numbers version 2.23.0-rc.4 that now looks for RBNF rules in both the requested locale and then falls back to the root locale (called "und" from ex_cldr 2.24). The changelog entry is:

Bug Fixes