#localization #icu4x

i18n_provider-rizzen-yazston

The i18n_provider crate of the Internationalisation project

5 releases (3 breaking)

0.9.1 Mar 24, 2024
0.9.0 Mar 21, 2024
0.8.0 Feb 3, 2024
0.7.0 Dec 18, 2023
0.6.1 Jul 6, 2023

#333 in Internationalization (i18n)

Download history 9/week @ 2024-01-30 1/week @ 2024-02-13 25/week @ 2024-02-20 54/week @ 2024-02-27 2/week @ 2024-03-05 6/week @ 2024-03-12 255/week @ 2024-03-19 19/week @ 2024-03-26 38/week @ 2024-04-02

312 downloads per month
Used in 5 crates (4 directly)

BSD-3-Clause

61KB
716 lines

i18n_provider

Rizzen Yazston

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

This crate consists of two modules:

  • error: Contains the enum for common errors regardless of the implementation of the localisation provider trait,

  • provider: The localisation provider trait.

Features

Available features for i18n_provider crate:

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

Modules

provider: A language string provider.

A trait for retrieving localisation language strings from a data repository via a provider that implements the trait methods: strings() and string(). In addition, there are other trait methods for retrieve the default language for a component, and supported languages for entire data repository, component and identifier respectively.

For an implementation example, see the i18n_provider_sqlite3-rizzen-yazston crate, which uses Sqlite3 for its data store.

Acknowledgement

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

Dependencies

~4MB
~78K SLoC