hansihe

hansihe

Icu - Fast and lightweight Localization for Elixir

Icu is a localization library for Elixir. It wraps the icu4x library by the Unicode consortium (with a Rustler NIF).

Docs

Some highlights:

  • Ships with every locale in the basic, moderate and modern CLDR 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 icu4x library
  • Already used heavily in production
  • Otherwise a very boring library :slight_smile:

Some caveats:

  • Limited set of functionality, not as comprehensive as the cldr set of Elixir libraries.
    • Contributions are very welcome if you need more icu4x functionality exposed.
  • Uses a NIF, which may not be something you want.
  • NIF library is relatively heavy, it contains a lot of locale data.
    • icu4x is 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 the icu elixir library more customizable for embedded users as well!

https://github.com/hansihe/icu_ex

First Post! Switch mode

kip

kip

ex_cldr Core Team

That’s great work. Maybe this is a better way to go for localisation in Elixir than the ex_cldr libs?

Most Liked

kip

kip

ex_cldr Core Team

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).

hansihe

hansihe

That’s great news! That will certainly eliminate the biggest pain we have currently. I would be happy if this library became unnecessary for us :slight_smile:

let me know of other pain points you found too, so I can try and mitigate them in the future

Thanks, will do!

Schultzer

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.

Where Next?

Trending in Announcing Top

bluzky
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...
385 14863 120
New
JesseHerrick
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
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
zachdaniel
Introducing AshStorage! Attachment and file management that slots directly into your resources :smiling_face_with_sunglasses: I had hope...
New

Other Trending Topics Top

type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@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
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
bjorng
We want to introduce a new native datatype to Erlang: native records. Although replacing all tuple records with native records is not our...
New
spammy
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
yureehuh
Introduction Founded in 2017 by landscape ecologist and fire mitigation expert Harry Statter, Frontline developed the first fully integra...
New

We're in Beta

About us Mission Statement