kip
ex_cldr Core Team
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project.
Unicode released CLDR version 34 this week and ex_cldr is now updated to reflect that data which now consists of 537 locales that can be used in Elixir.
The full list of updated packages (core and optional) is:
- ex_cldr version 1.8.0
- ex_cldr_numbers version 1.6.0
- ex_cldr_dates_times version 1.4.0
- ex_cldr_lists version 1.2.0
- ex_cldr_units version 1.3.0
Also updated is ex_money since it uses ex_cldr and friends under the cover for localisation and formatting:
- ex_money version 2.11.0
This is expected to be the last functional release of ex_cldr version 1.x with the release of the 2.0 by the end of this year. Bugs in 1.x will of course continue to be eradicated as quickly as possible.
Trending in Announcing
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub.
Docs are at OpenaiEx User Gu...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly.
One of i...
New
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto.
pagination
cursor pagination
sorta...
New
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New
Other Trending Topics
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
kip
Cldr version 2.0 has just been released on hex. Its a major version bump with breaking changes - primarily to restructure the code in the manner of Ecto, Phoenix and Gettext by requiring the provision of a
<backend>module into which most of the public API that hosts the CLDR content is generated. It gets rid of the horrid:ex_cldrcompiler.ex_cldr provides the underlying data that powers number, date time, list, units and territory formatting in over 500 different locals. Its also used to underpin ex_money.
The changelog contains the changes. Several of the dependent packages are also updated:
Some packages will be updated over the next two weeks:
gdub01
Hey Kip - thanks for this library!
I’m trying to determine whether I should use CLDR or AINA, or both, to specify languages in my app.
Your library/CLDR follows RFC 5646.
W3 also recommends RFC 5646 -
Language tags in HTML and XML … but also refers to https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry as the source of truth for RFC 5646.
However, some language codes in iana’s registry are not available in Cldr’s registry:
CLDR still parses it and gets the language key filled out, though:
so that’s great. But that language isn’t found:
Do you know why does CLDR not have a language code that AINA has, given they’re following the same spec?
I think it’s because the spec is bcp47, which they both follow.. But I’m not sure how AINA has a higher quantity of language tags, where CLDR has language-REGION tag combos which are not specified IANA’s registry.
I’m ultimately trying to ensure I’m using languages properly as my organization has a massive amount of languages.
I’m wondering about storing AINA’s codes separately from CLDR, and using your library to augment AINA’s codes where possible with the wealth of extra data your lib provides. Just was interested in your thoughts on AINA vs. CLDR if you had any, and if you think there’s room to use both.
Thanks!
kip
All but one of the companion libs is now updated.
Cldr.DatesTimesis being actively updated to reflect the newCalendarfunctions inElixir 1.8and will be out by the end of January.kip
@gdub01, thanks for your interest. The difference is primarily that CLDR is not a registry but a data repository. (Common Locale Data Repository). Whilst
ex_cldrwill parseadqas a valid language tag,CLDRdoesn’t have any translation data so therefore you see that thecldr_localefield in the struct is empty.There are 533 languages supported in the current CLDR version 34 repository.
If your primary objective is to detect valid language tags then I think the two choices are:
If your primary objective is application localisation then I think CLDR is the most comprehensive repository available and it underpins most of the application domain globally - often through the libs
icu4candicu4j.ex_cldris an elixir implementation that largely matches the functionality oficu4jfor output but does not implement parsing.gdub01
Thanks so much @kip ! I think I’ll go with CLDR & AINA. Appreciate it.
kip
A few long flights have given an opportunity to make some updates to the
ex_cldrset of libraries:ex_cldr_print provides C-compatible
printf/3andsprint/3functions for formatting strings. Since its built on CLDR data, it includes localising for grouping characters, decimal points and exponent characters. It also means you can output in different digit systems (like thai, arab and so on). So far only on GitHub, it needs further tuning and some development before a hex.pm release.ex_cldr_collation which implements locale-specific collations (sorting). NIF-based, it currently only supports the default CLDR collation. This lib is based upon the erlang library erlang-ucol. Next step is to support the full range of collations for configured locales.
kip
CLDR version 35 was release on March 27th and is now incorporated into updates to the
cldr_*family on hex. CLDR supports localisation of number, dates, times, lists, units for 540 locales. It supports multiple calendars (coming soon in ex_cldr_calendars) as well.Summary of CLDR 35.0.0 update
Related Cldr releases on Hex
Migration from earlier versions of Cldr
No code changes are expected for client applications however since CLDR is a data repository, underlying data may have changed.
kip
I have pushed to hex a new member of the
ex_cldr_*family of packages:ex_cldr_calendars.From the readme:
Cldr Calendarsbuilds on Elixir’s standardCalendarmodule to provide additional calendars and calendar functionality intended to be of practical use. In particularCdlr Calendars:Provides support for configurable month-based and week-based calendars that are in common use as “Fiscal Year” calendars for countries and organizations around the world. See
Cldr.Calendar.new/3Supports localisation of common calendar terms such as “day of the week” and “month of the year” using the CLDR data that is available for over 500 locales. See
Cldr.Calendar.localize/3Supports locale-specific knowledge of what is a weekend or a workday. See
Cldr.Calendar.weekend/1,Cldr.Calendar.weekend?/2,Cldr.Calendar.weekdays/1andCldr.Calendar.weekday?/2.Provides convenient
Date.Rangecalculators for years, quarters, months and weeks for calendars and provides the means to move to thenextandpreviousperiod in a calendar where a period may be a year, quarter, month, week or day.Supports adding or substracting periods to dates and date ranges. See
Calendar.plus/3andCalendar.minus/3Includes pre-defined calendars for Gregorian (compatible with the builtin
Calendarmodule),ISOWeekandNational Retail Federation (NRF)calendarsIncludes functions to find the first, last, nearest and
nthdays of the week from a date. For example, find the2nd Tuesday in November.kip
ex_cldr_calendars_format is a new member of the
cldr_*family of libs that formats calendars - either standardCalendar.ISOcalendars or any calendar that implements theCldr.Calendarbehaviour. Given its platform it provides localised formatting. Formatting is done by any module that implements theCldr.Calendar.Formatterbehaviour, Formatters for HTML (basic formatting and another formatter for week-based calendars) and Markdown are included. Its easy to implement a formatter - there are only four callbacks.A couple of examples:
Which when rendered produces:
And its easy to localise:
Which renders as:
Thats all for calendars for now. Back to finally finishing up
ex_cldr_dates_timeswhich neededex_cldr_calendarsto be done as a prerequisite.kip
Unicode has released CLDR version 35.1.0.
In addition to updates related to the new Reiwa era, the CLDR 35.1 release includes a small number of other updates, including more localized name updates for North Macedonia, and support for tzdata 2019a.
As a result, ex_cldr version 2.7.0 is now published to support CLDR version 35.1.0.