-
Hello, I tried to update the I can easily detect that the given country code has no localized version, that's no problem. But would have expected that there is a translation for each combination of known country code and locale known to ex_cldr. But maybe that's a wrong assumption. Thanks for taking a look! Steps to reproduce in livebook: # Investigating missing country code CQ
```elixir
Mix.install([
{:jason, "~> 1.4"},
{:ex_cldr, "== 2.37.0"},
# country code `:CQ` doesn't appear in version 2.36.0
# {:ex_cldr, "== 2.36.0"},
{:ex_cldr_territories, "~> 2.6"}
]) Sectiondefmodule Sample.Cldr do
use Cldr,
providers: [Cldr.Territory],
locales: ["nl", "en"]
end cq_country_code = :CQ = Cldr.Territory.country_codes() |> Enum.find(&(&1 == :CQ)) # all is ok here
Cldr.Territory.from_territory_code(cq_country_code, Sample.Cldr, locale: "en") # raises exception
Cldr.Territory.from_territory_code(cq_country_code, Sample.Cldr, locale: "nl")
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Thanks for raising the issue @linusdm. CLDR 42 and easier (ex_cldr version 2.36 and earlier) only "published" locales that had full data coverage. CLDR 43 consolidated all of the known locales into a single release package (loosely speaking). Which means that ex_cldr libs need to be tolerate of data being missing. I had to make several changes in various libs to work in that way. In this particular case, given that CQ is marked as "reserved at the request of the UK" and that it represents the somewhat self-governing island of Sark (actually, it may be the last feudal territory on earth) I'm not too surprised that translations are missing. Nevertheless that doesn't help you! Hopefully @Schultzer can join the conversation and we can establish a policy to be applied when translations aren't available. For now (like right now) all I can suggest is to manually omit |
Beta Was this translation helpful? Give feedback.
-
What you're seeing is an artefact of the assumption that ask data was localized for all locales. That's no longer a valid assumption. So I had to adjust a lot of libraries to recognise that fact. And @Schultzer will need to do the same for Most of the |
Beta Was this translation helpful? Give feedback.
-
I @linusdm did you try out HEAD? I cannot replicate it on HEAD, and I assume the issue stems from my forgetfulness in publishing a new release. |
Beta Was this translation helpful? Give feedback.
Thanks for raising the issue @linusdm.
CLDR 42 and easier (ex_cldr version 2.36 and earlier) only "published" locales that had full data coverage. CLDR 43 consolidated all of the known locales into a single release package (loosely speaking).
Which means that ex_cldr libs need to be tolerate of data being missing. I had to make several changes in various libs to work in that way.
In this particular case, given that CQ is marked as "reserved at the request of the UK" and that it represents the somewhat self-governing island of Sark (actually, it may be the last feudal territory on earth) I'm not too surprised that translations are missing.
Nevertheless that doesn't help you! Hopefully @Sch…