Skip to content

Commit

Permalink
fixed islands with new context argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptistemontan committed Nov 13, 2024
1 parent d6f1aa8 commit 58562c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions leptos_i18n_macro/src/load_locales/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,19 @@ fn load_locales_inner(
/// Specify a name for the cookie, default to the library default.
#[prop(optional, into)]
cookie_name: Option<Cow<'static, str>>,
/// Try to parse the locale from the URL pathname, expect the basepath. (default to `None`).
/// If `None` do nothing, if `Some(base_path)` strip the URL from `base_path` then expect to found a path segment that represent a locale.
/// This is usefull when using the `I18nRoute` with usage of the context outside the router.
#[prop(optional, into)]
parse_locale_from_path: Option<Cow<'static, str>>,
children: Children
) -> impl IntoView {
l_i18n_crate::context::provide_i18n_context_component_island::<#enum_ident>(
set_lang_attr_on_html,
set_dir_attr_on_html,
enable_cookie,
cookie_name,
parse_locale_from_path,
children
)
}
Expand Down

0 comments on commit 58562c6

Please sign in to comment.