2 stable releases

1.2.4 Mar 9, 2023
1.2.3 Mar 8, 2023
1.1.1 Mar 8, 2023
1.0.0 Mar 8, 2023
0.1.0 Mar 1, 2023

#303 in Internationalization (i18n)

Download history 31/week @ 2024-07-28 9/week @ 2024-09-22 7/week @ 2024-09-29

63 downloads per month
Used in rialight

ISC license

61KB
1K SLoC

rialight::intl

Internationalization module.

Progress

Use either the Ecma-262 Intl or the ICU4X project for implementing several things.

Not all browsers implement all of Ecma-262 Intl API, or ICU4X doesn't cover all of Intl, so we'll have to support less Intl things for the time being. The goal of this crate is to implement all of Intl. Add more checkboxes for specific features here.

  • Currently the text_direction() is incorrectly implemented. It compares the language part, not the script part. To fix that, LocaleExpander from icu provides a maximize method, but the constructor requires the data provider. https://github.com/unicode-org/icu4x/issues/3172#issuecomment-1462282871
  • Include icu data only for non-WebAssembly target.
  • Learn how to use js! macro from stdweb.
  • Collator
    • Using icu
    • Using browser-available Ecma-262 Intl
  • DateTimeFormat
    • Using icu
    • Using browser-available Ecma-262 Intl
  • DisplayNames
    • Using icu. Use LanguageDisplayNames and RegionDisplayNames from icu_displaynames
    • Using browser-available Ecma-262 Intl
  • ListFormat
    • Using icu
    • Using browser-available Ecma-262 Intl
  • Locale
  • NumberFormat
    • Using icu
    • Using browser-available Ecma-262 Intl
  • PluralRules
    • Using icu
    • Using browser-available Ecma-262 Intl
  • RelativeTimeFormat
    • Using icu
    • Using browser-available Ecma-262 Intl
  • Segmenter
    • Using icu
    • Using browser-available Ecma-262 Intl

FTL Progress

  • Arguments
  • arguments!
  • Ftl
    • Should the library internally use fluent::FluentBundle::new_concurrent()?
    • initialize_locale()
ftl.initialize_locale(|locale, bundle| {
    // locale: intl::Locale
    match locale {
        _ => {},
    }
});

Dependencies

~17–31MB
~440K SLoC