8 releases

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

#435 in Internationalization (i18n)

Download history 39275/week @ 2024-09-23 43943/week @ 2024-09-30 37421/week @ 2024-10-07 14275/week @ 2024-10-14 7599/week @ 2024-10-21 7085/week @ 2024-10-28 8179/week @ 2024-11-04 6903/week @ 2024-11-11 7577/week @ 2024-11-18 5756/week @ 2024-11-25 6718/week @ 2024-12-02 7439/week @ 2024-12-09 7190/week @ 2024-12-16 4288/week @ 2024-12-23 4825/week @ 2024-12-30 6303/week @ 2025-01-06

23,142 downloads per month
Used in 28 crates (4 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

~240–770KB
~18K SLoC