6 releases

0.2.5 Sep 10, 2024
0.2.3 Sep 3, 2024
0.2.0 Aug 31, 2024
0.1.0 Aug 31, 2024

#52 in Accessibility

Download history 296/week @ 2024-08-26 266/week @ 2024-09-02 163/week @ 2024-09-09 59/week @ 2024-09-16 112/week @ 2024-09-23 71/week @ 2024-09-30 68/week @ 2024-10-07 22/week @ 2024-10-14 13/week @ 2024-10-21 39/week @ 2024-10-28 50/week @ 2024-11-04 25/week @ 2024-11-11 104/week @ 2024-11-18

220 downloads per month

MIT license

51KB
160 lines

dioxus-i18n 🌍

i18n integration for Dioxus apps based on the Project Fluent.

This crate used to be in the Dioxus SDK.

Support

  • Dioxus v0.5 🧬
  • All renderers (web, desktop, freya, etc)
  • Both WASM and native targets

Example:

# en-US.ftl

hello = Hello, {$name}!
// main.rs

fn app() -> Element {
    let i18 = use_init_i18n(|| {
        I18nConfig::new(langid!("en-US"))
            .with_locale(Locale::new_static( // Embed
                langid!("en-US"),
                include_str!("./en-US.ftl"),
            ))
            .with_locale(Locale::new_dynamic( // Load at launch
                langid!("es-ES"),
                include_str!("./es-ES.ftl"),
            ))
    });

    rsx!(
        label { { t!("hello", name: "World") } }
    )
}

MIT License

Dependencies

~5–11MB
~121K SLoC