8 releases

new 0.3.0 Nov 23, 2024
0.2.0 May 28, 2024
0.1.5 Sep 22, 2023
0.1.4 Apr 13, 2023
0.1.0 Apr 29, 2021

#433 in Internationalization (i18n)

Download history 6765/week @ 2024-08-03 8941/week @ 2024-08-10 6202/week @ 2024-08-17 6711/week @ 2024-08-24 5690/week @ 2024-08-31 7641/week @ 2024-09-07 8425/week @ 2024-09-14 38868/week @ 2024-09-21 43741/week @ 2024-09-28 38761/week @ 2024-10-05 15784/week @ 2024-10-12 7626/week @ 2024-10-19 6966/week @ 2024-10-26 8194/week @ 2024-11-02 7224/week @ 2024-11-09 5896/week @ 2024-11-16

29,426 downloads per month
Used in 28 crates (3 directly)

Unicode-3.0

375KB
6.5K SLoC

icu_pattern crates.io

icu_pattern is a utility crate of the ICU4X project.

It includes a Pattern type which supports patterns with various storage backends.

The types are tightly coupled with the writeable crate.

Examples

Parsing and interpolating with a single-placeholder pattern:

use icu_pattern::SinglePlaceholderPattern;
use writeable::assert_writeable_eq;

// Parse a pattern string:
let pattern = SinglePlaceholderPattern::try_from_str(
    "Hello, {0}!",
    Default::default(),
)
.unwrap();

// Interpolate into the pattern string:
assert_writeable_eq!(pattern.interpolate(["World"]), "Hello, World!");

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.

Dependencies

~0.3–0.8MB
~18K SLoC