icu

ICU4X: the Rust meta-crate for internationalization — locale-aware dates, collation, casing, segmentation, and more

Library
Cargo
v2.3.0
1,851stars
Unicode-3.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
90/100Excellent
Development Activity100
Maintenance84
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture84
Code Quality85
Innovation82
Learning Curve60

icu is the main meta-crate of the ICU4X project, the Unicode Consortium’s from-scratch reimplementation of International Components for Unicode in Rust. It re-exports the project’s individual component crates (calendar, datetime, collator, decimal, list, locale, normalizer, plurals, properties, segmenter, casemap, time) as modules under a single dependency, so applications get comprehensive, locale-aware internationalization support without wiring up a dozen sub-crates by hand.

ICU4X was designed from day one for client-side and resource-constrained environments: it supports no_std, pluggable locale data (compiled-in for zero-cost defaults, or loaded explicitly via a DataProvider), and dead-code elimination so unused locale data doesn’t bloat binaries. It is developed under Unicode Consortium governance by the ICU4X Technical Committee, drawing on the same CLDR data and ECMA-402 API compatibility goals as ICU4C/J.

What You Get

  • A single icu dependency that re-exports every core ICU4X component as a module (icu::calendar, icu::datetime, icu::collator, icu::locale, etc.)
  • Locale-aware date/time formatting (DateTimeFormatter) with compiled-in CLDR data by default and zero-cost data loading
  • Pluggable data providers for clients that need custom locale data sets instead of the compiled-in default
  • no_std compatibility for embedded and resource-constrained targets, alongside full-featured desktop/server use
  • Unicode-correct collation, casemapping, pluralization, list formatting, and text segmentation, all consistent with CLDR/ECMA-402 semantics

Common Use Cases

  • Formatting dates, times, and numbers according to a user’s locale in a Rust web service or CLI application
  • Locale-correct string collation and sorting for internationalized search or list-display features
  • Client-side (WASM/embedded) internationalization where a full ICU4C dependency is too heavy
  • Text segmentation (word/line/sentence boundaries) and case mapping for multilingual text processing pipelines

Under The Hood

Architecture: icu is a thin facade crate (components/icu/src/lib.rs) that re-exports each ICU4X component crate as a module, so icu::datetime is identical to depending on icu_datetime directly — the crate exists purely to collect the most-used functionality behind one dependency. The wider ICU4X workspace splits functionality into ~17 component crates under components/ (calendar, casemap, collator, collections, datetime, decimal, list, locale, locale_core, normalizer, pattern, plurals, properties, segmenter, time, experimental) plus a separate provider/ tree implementing the DataProvider trait for both compiled and dynamically-loaded locale data, and an ffi/ tree for exposing the same functionality to other languages (JS, Dart, Kotlin, C++).

Tech Stack: Almost entirely Rust (95% of the codebase) with WebAssembly, JavaScript, Jinja (codegen templates), Dart, Kotlin, and C++ supporting the multi-language FFI story. The workspace Cargo.toml centralizes shared metadata (license, edition, rust-version) across every component crate. Data is sourced from CLDR and compiled via an icu4x-datagen tool, with ICU4X_DATA_DIR supporting custom, size-optimized data sets.

Code Quality: The crate denies unwrap()/expect()/panic!/indexing_slicing via crate-level clippy lints outside tests (#![deny(clippy::unwrap_used, ...)]), a strict discipline for a library expected to run in no_std/embedded contexts where panics are especially costly. #![warn(missing_docs)] enforces documentation coverage. With 143 contributors, ~5,159 commits, and governance by a dedicated Unicode Technical Committee with quarterly release cadence recorded in CHANGELOG.md, the project shows unusually formal review and maintenance processes for an open-source crate.

API Design: The re-export design means icu::datetime::DateTimeFormatter::try_new(locale!("es").into(), YMD::long()) reads as a single coherent API surface despite spanning many underlying crates, and compiled-locale-data defaults mean most users never touch the DataProvider trait directly — only projects with custom locale-data needs opt into that extra complexity.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search