hansihe
Icu is a localization library for Elixir. It wraps the icu4x library by the Unicode consortium (with a Rustler NIF).
Some highlights:
- Ships with every locale in the
basic,moderateandmodernCLDR coverage levels by default. - Fast compile times. Downloads precompiled NIF by default.
- Simple to use, minimal configuration, no backends.
- Implements:
- BCP-47 handling
- Number
- List
- Temporal (DateTime, NaiveDateTime, Date, Time)
- Relative Temporal
- Currency formatting
- Backed by the proven
icu4xlibrary - Already used heavily in production
- Otherwise a very boring library

Some caveats:
- Limited set of functionality, not as comprehensive as the
cldrset of Elixir libraries.- Contributions are very welcome if you need more
icu4xfunctionality exposed.
- Contributions are very welcome if you need more
- Uses a NIF, which may not be something you want.
- NIF library is relatively heavy, it contains a lot of locale data.
icu4xis already optimized rather heavily for embedded use cases, you have loads of options to reduce library size by selecting only the data you require. Contributions are very welcome to make theicuelixir library more customizable for embedded users as well!
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kip
That’s great work. Maybe this is a better way to go for localisation in Elixir than the
ex_cldrlibs?Schultzer
I think both libraries have value, would be cool to have benchmarks of both so people have more data points for which and when they should choose one or the other. But also both suffer the same pain that not all data is exposed and need continuous maintenance and contributions.
kip
Is there some particular data you’re thinking of that’s in CLDR but not exposed?
Schultzer
No, but if you look in this repo you’ll see what I mean.
hansihe
Are you referring to the
datadirectory?This is automatically generated by a script, was planning on automating publishing updates with CI at some point, but I haven’t gotten there yet.
hansihe
Thanks!
I am unsure, it certainly has some advantages around compile time and not having to implement a ton of the algorithms.
On the other hand it does use a NIF, which I know some people have a high threshold for using in production.
icu4xis also not fully feature-complete. There are probably a few things which are not present inicu4xat all whichex_cldrhas. As an example, when implementing it for our use case I had to get some currency stuff exposed from upstreamicu4xwhich we needed.Schultzer
I’m thinking the nif and lib, unless that is what you’re generating. And also you mentioned you had to make changes to icux itself.
I do believe that we can make ex_cldr compile a lot faster, especially by leveraging persistent_term. Anyway I believe that runtime behaviour is more interesting.
hansihe
Ah if you mean that code need to be written in the library to expose this stuff then this is true. I would be curious to hear what you think the alternative here would be through.
If
ex_cldrcompilation can be made a lot faster then that is great news! This is one of the main pain points which made us write this library.Schultzer
My comment on the generation was directed at Kip’s question if icux would be a better foundation to build on, I disagree as both solutions faces similar constraints with regards to maintaining and data exposure.
So it does do make it easier. The two approaches have similar value with different trade offs.
Whats great about ex_cldr is that it’s all in Elixir and if we can it should be used as a target for making the BEAM compiler faster.
kip
The upcoming Localize (ex_cldr 3.0) will compile much much faster. The current bottleneck is the compiler phase that deals with multiple functions heads. Its gets very very slow when there are many many function heads - and thats relied upon heavily in the current implementation. The new implementation is runtime only (no compile time config), uses persistent_term for data storage (not compiled artifacts - with a couple of exceptions).