elixir-cldr / cldr

Elixir implementation of CLDR/ICU
Other
455 stars 34 forks source link

Subdivision translation #144

Closed mskv closed 3 years ago

mskv commented 3 years ago

Hello @kipcole9 . This PR is a start of a conversation about a new feature. Currently it is possible to retrieve children of various regions:

iex(8)> Cldr.known_territory_subdivisions[:DE]
["debb", "debe", "debw", "deby", "dehb", "dehe", "dehh", "demv", "deni", "denw",
 "derp", "desh", "desl", "desn", "dest", "deth"]

But we cannot get translations of those values. It seems like a very common use case to allow the user to choose a country, followed by choosing a subdivision of that country. CLDR does contain subdivision translations for some of the locales. We could include that in the library, and maybe expose them via Cldr.Subdivision or add to Cldr.Territory. Do you have any thoughts on this?

kipcole9 commented 3 years ago

Thanks very much for the contribution, I really appreciate it. In parallel I have started work on localisations for locale names for the same reason - UI translation requirements for language (locale) selection.

I think in this case it fits best into ex_cldr_territories which is developed by @Schultzer. WDYT?

kipcole9 commented 3 years ago

Very happy to update the core ex_cldr lib with your PR though, appreciate the contribution.

kipcole9 commented 3 years ago

I have merged your PR into the cldr39 branch. That means it will go out in the April release of ex_cldr version 2.20 which is aligned to CLDR release 39. If that timing ok for you?

Also, amazing work in doing all this - the development process isn't documented as well as I'd like although when set up the CLDR build process is pretty straight forward.

If you have any observations or suggestions on improving the development process please let me know. Except for both CLDR and ex_cldr being large repositories, I'll aim to improve whatever I can.

Schultzer commented 3 years ago

@mskv Thanks for making this more complete with inclusion of subdivision.

I think in this case it fits best into ex_cldr_territories which is developed by @Schultzer. WDYT?

I second that.

I'll like to encourage you, to open a PR in cldr_territories.

mskv commented 3 years ago

@kipcole9 @Schultzer Thank you both for the quick response.

That means it will go out in the April release of ex_cldr version 2.20 which is aligned to CLDR release 39. If that timing ok for you?

I'll like to encourage you, to open a PR in cldr_territories.

Will do, I should make it by the April release. I'll try to find time this weekend.

If you have any observations or suggestions on improving the development process please let me know. Except for both CLDR and ex_cldr being large repositories, I'll aim to improve whatever I can.

The DEVELOPMENT.md document was very straightforward and worked perfectly. Great writeup.

If I were to add anything, it would be a more detailed description of the workings of the library. Maybe a section at the beginning of DEVELOPMENT.md? Currently it is impossible to grasp a good understanding of the setup without reading lots of code. Even the contract between ex_cldr and companion libs is not described.

However, I do realize that documentation is a tradeoff and not a pure positive, as it needs to be first of all created, and then maintained. I can't say for sure it would be worth the trouble. If someone wants to contribute, they need to get familiar with the codebase anyway, right? What you have already allows to get things running just fine.

kipcole9 commented 3 years ago

To be clear, version 2.20.0 of ex_cldr will be out in April and this is the release that will package the subdivisions translations (thanks again for the PR).

The ex_cldr_territories library update can happen any time at all depending on what you and @Schultzer agree on. So you don't need to be ready in April. But you will need me to publish ex_cldr 2.20.0.

kipcole9 commented 3 years ago

If I were to add anything, it would be a more detailed description of the workings of the library. Maybe a section at the beginning of DEVELOPMENT.md? Currently it is impossible to grasp a good understanding of the setup without reading lots of code. Even the contract between ex_cldr and companion libs is not described.

Good callout, will work on that as well. The parts of the code that transform CLDR data into ex_cldr aren't always the code I'm very proud of - it was my earliest days getting into Elixir. One day, when version 3.0 is in the frame, I will aim to rewrite most of that to make it a more structured transformation process. But for now .... better architecture documentation on how everything fits together makes a lot of sense.

kipcole9 commented 3 years ago

I have just published ex_cldr version 2.20.0-rc.0. It can be used with your PR for ex_cldr_territories. I don't expect this library to change between now and formal release in April (aligned with the CLDR39 release) other than for bug fixes.