Crates.io | dioxus-i18n |
lib.rs | dioxus-i18n |
version | |
source | src |
created_at | 2024-08-31 13:32:55.301795 |
updated_at | 2024-12-10 10:26:39.264963 |
description | i18n integration for Dioxus apps based on Fluent Project. |
homepage | |
repository | https://github.com/dioxus-community/dioxus-i18n |
max_upload_size | |
id | 1358856 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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( // 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") } }
)
}