$ icu_locale_core
v2.2.0MAJOR UPDATEAPI for managing Unicode Language and Locale Identifiers
Latest Update Summary
Crate
Name: icu_locale_core New version: 2.1.0 Release date: 2025-05-07T21:21:21Z
Crate readme
Short description ICU4X provides components enabling wide range of software internationalization.
Long description ICU4X is fully implemented in the Rust programming language and aims to provide client-side internationalization features for modern platforms like web, iOS, and Android. It focuses on small, modular code, pluggable locale data, and ease of use across multiple programming languages. The project draws from the experiences of ICU4C/J, ECMA-402, and relies on CLDR data.
Features • Small and modular code • Pluggable locale data • ECMA-402-compatible API surface • Support for Rust, JavaScript, Objective-C, Java, Dart, and C++
Code Examples Add to Cargo.toml
[dependencies]
icu = "2.0.0"
Basic usage
use icu::calendar::Date;
use icu::datetime::{DateTimeFormatter, fieldsets::YMD};
use icu::locale::locale;
let dtf = DateTimeFormatter::try_new(
locale!("es").into(),
YMD::long()
)
.expect("locale should be present in compiled data");
let date = Date::try_new_iso(2020, 9, 12).expect("date should be valid");
let formatted_date = dtf.format(&date).to_string();
assert_eq!(
formatted_date,
"12 de septiembre de 2020"
);
Links • https://icu4x.unicode.org • https://crates.io/crates/icu • https://github.com/unicode-org/icu4x • https://www.unicode.org/consortium/techchairs.html • https://www.unicode.org/license.txt
https://api.github.com/repos/unicode-org/icu4x/releases/217170091
Release info
Release version: 2.0
Release description
The ICU4X 2.0 release introduces significant changes aimed at enhancing the performance and usability of the internationalization (i18n) library. Notable updates since version 1.5 include the introduction of Preference Objects, which allow constructors to accept 'preference bags' rather than directly using Locale objects, thus improving efficiency. Additionally, there is a comprehensive Date, Time, and Time Zone rewrite in the icu::datetime component, which now utilizes a new icu::time component that better handles i18n-focused representations. The FFI Overhaul enhances C++ namespaces and function versioning while making idiomatic improvements across various languages. Performance enhancements are further implemented with Borrowed variants, which provide separate owned and borrowed types to optimize usage, enabling certain components to be compiled without an allocator for a fully #[no_std] experience. Finally, all components now include the latest data versions from CLDR (47.0) and Unicode (16.0), reflecting the most current standards in localization.
Code Examples
Minor update: 2.1.1 → 2.2.0
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add icu_locale_coreOr add to Cargo.toml: icu_locale_core = "2.2.0"