Closed LostKobrakai closed 6 years ago
Probably because pattern_for
does return error tuples, but verify_unit()
does only check for boolean true.
Hmmmm. I'm not seeing the error. Anything else you can suggest to help me pin it down?
iex> Cldr.Unit.to_string 1234, :gallon, format: :short, locale: "de_DE"
{:ok, "1 Tsd. Gallonen"}
iex> Cldr.Unit.to_string 1234, :gallon, format: :short, locale: "ro"
{:error, {Cldr.UnknownLocaleError, "The locale \"ro\" is not known."}}
You have helped me (a) fix a messed up doctest and (b) identify a bug in Cldr.validate_locale/1
for locale names like en-XX
where XX
is not a valid territory.
Ahhh, can reproduce - poor handling of invalid unit types (what you said above). Fixing now.
Using v0.4.2 I get the following unexpected function call result:
This doesn't seem like a desirable way of reporting an error besides the fact that "de" should be known.