#localization #icu4x

i18n_utility-rizzen-yazston

The i18n_utility crate of the Internationalisation project

8 releases (4 breaking)

0.10.1 Nov 15, 2024
0.10.0 Aug 2, 2024
0.9.2 Jul 23, 2024
0.9.1 Mar 24, 2024
0.6.1 Jul 6, 2023

#187 in Internationalization (i18n)

Download history 9/week @ 2024-08-17 10/week @ 2024-08-24 10/week @ 2024-08-31 2/week @ 2024-09-07 24/week @ 2024-09-14 39/week @ 2024-09-21 33/week @ 2024-09-28 3/week @ 2024-10-05 10/week @ 2024-10-12 4/week @ 2024-10-19 2/week @ 2024-10-26 8/week @ 2024-11-02 90/week @ 2024-11-09 60/week @ 2024-11-16 17/week @ 2024-11-23 14/week @ 2024-11-30

183 downloads per month
Used in 9 crates (8 directly)

BSD-3-Clause

42KB
548 lines

i18n_utility

Rizzen Yazston :icu4x: https://github.com/unicode-org/icu4x :url-unicode: https://home.unicode.org/ :BCP_47_Language_Tag: https://www.rfc-editor.org/rfc/bcp/bcp47.txt

Welcome to the i18n_utility crate of the Internationalisation (i18n) project.

This crate consists of five modules:

  • error: Contains the error enum for the language registry,

  • language: Registry of language tags with ICU4X's LanguageIdentifier or Locale instances,

  • tagged_string: Simple tagged string type,

  • traits: Traits for localisation of structs and enums,

  • types: Simple struct and enum types.

Features

Available features for i18n_utility crate:

  • icu_extended: Use the more detailed ICU information structs, types, and methods.

  • sync: Allow for rust's concurrency capabilities to be used. Use of Arc and Mutex instead Rc and RefCell.

Modules

language: Registry for holding ICU4X LanguageIdentifier or Locale instances.

Registry for holding the validated {BCP_47_Language_Tag}[BCP 47 Language Tag] strings, and optionally holding the ICU4X LanguageIdentifier or Locale (using feature icu_extended) instances.

The purpose of the registry is to reduce the need of parsing language tags repeatedly, by storing the validated language tag against the requested language tag.

The LanguageIdentifier or Locale type can be provided by either the icu_locid crate or the icu meta-crate. These two crates are part of the {icu4x}[ICU4X] project developed by the {url-unicode}[Unicode Consortium].

tagged_string: Tagged string.

The immutable TaggedString type simply associates a language tag ([Rc]<LanguageTag> or [Arc]<LanguageTag>) to a text string (String).

In the context of the i18n project, the identifier tag is expected to be a {BCP_47_Language_Tag}[BCP 47 Language Tag] string.

Acknowledgements

Stefano Angeleri for advice on various design aspects of implementing the library of the Internationalisation project, and also providing the Italian translation of error message strings.

Dependencies

~4MB
~75K SLoC