dioxus-i18n 🌍
i18n integration for Dioxus apps based on the Project Fluent.
This crate used to be in the Dioxus SDK.
Support
Example:
# en-US.ftl
hello = Hello, {$name}!
// main.rs
i18n integration for Dioxus apps based on the Project Fluent.
This crate used to be in the Dioxus SDK.
# 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(
langid!("en-US"),
include_str!("./en-US.ftl"),
))
});
rsx!(
label { {translate!(i18, "hello", name: "World")} }
)
}