Closed mondeja closed 3 months ago
It would be great to allow extracting the initial value. This is inspired by https://github.com/Baptistemontan/leptos_i18n/issues/31
My proposal is that the API should accept a closure or function for a new option url_path that would return the locale string. For example, extract from first subdirectory:
url_path
// "/en/path/to/resource?foo=bar" -> "en" fn extract(path: &str) -> &str { if let Some(language) = path.split('/').nth(1) { return language; } "" } leptos_fluent! {{ // ... url_path: extract, initial_value_from_url_path: true, }};
It would be great to allow extracting the initial value. This is inspired by https://github.com/Baptistemontan/leptos_i18n/issues/31
My proposal is that the API should accept a closure or function for a new option
url_path
that would return the locale string. For example, extract from first subdirectory: