$ icu_provider
v2.2.0MAJOR UPDATETrait and struct definitions for the ICU data provider
Latest Update Summary
Crate
Name: icu_provider 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 for products in resource-constrained environments. It features small and modular code, pluggable locale data, and aims for availability in multiple programming languages including Rust, JavaScript, Objective-C, Java, Dart, and C++. The project takes inspiration from ICU4C/J, ECMA-402, and utilizes data from the CLDR project.
Features • Small and modular code • Pluggable locale data • Availability in multiple programming languages • ECMA-402-compatible API surface • Support for resource-constrained environments
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://github.com/unicode-org/icu • https://www.npmjs.com/package/icu • https://pub.dev/packages/icu4x • https://www.unicode.org/consortium/techchairs.html • https://www.unicode.org/license.txt • https://www.unicode.org/policies/licensing_policy.html • https://www.unicode.org/copyright.html
https://api.github.com/repos/unicode-org/icu4x/releases/217170091
Release info
Release version: 2.0
Release description
ICU4X 2.0 introduces significant updates to the library, focusing on enhancing efficiency and usability. Notable changes since ICU4X 1.5 include the introduction of Preference Objects, which allow constructors to receive "preference bags" that can be created from locales or constructed with type-safe enums, improving performance. The icu::datetime component has been entirely rewritten for better performance and has been replaced by the icu::time component for handling internationalized date, time, and time zone representations. The FFI has been overhauled with improvements to C++ namespaces and function versioning, enhancing the experience across all languages. Additionally, there are more types with separate owned and borrowed variants, which boosts performance and allows some components to compile without an allocator, supporting #[no_std]. Lastly, all components are updated to include the latest versions of CLDR (47.0) and Unicode (16.0). Feedback from the 2.0 Beta releases has been instrumental in shaping this update.
Code Examples
Minor update: 2.1.1 → 2.2.0
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add icu_providerOr add to Cargo.toml: icu_provider = "2.2.0"