-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
How could i detect a locale and set it during the first server request?
Would be nice if this was a feature also... This is how I do it now
let mut il8n = use_init_i18n(|| {
I18nConfig::new(langid!("cs-CZ"))
.with_locale((
langid!("en-US"),
include_str!("./locales/en-US.ftl")
))
.with_locale((
langid!("cs-CZ"),
include_str!("./locales/cs-CZ.ftl")
))
});
// Use effect to update language after client-side hydration
use_effect(move || {
#[cfg(feature = "web")] {
let browser_locale = get_browser_locale();
il8n.set_language(browser_locale);
}
});matous-volf
Metadata
Metadata
Assignees
Labels
No labels