web / useLocalization
Function: useLocalization() ​
useLocalization():
object
Returns ​
object
buildCategoryLanguagePath() ​
buildCategoryLanguagePath: (
path
) =>string
Parameters ​
• path: string
category path that is provided by the category response to redirect after a language switch
Returns ​
string
category path that is then navigated to
Description ​
Function for wrapping the category language path.
Example ​
buildCategoryLanguagePath('')
buildCategoryMenuLink() ​
buildCategoryMenuLink: (
category
,categoryTree
) =>string
Parameters ​
• category: CategoryTreeItem
• categoryTree: CategoryTreeItem
[]
Returns ​
string
product path that is then navigated to
Description ​
Used to generate the category path inside the mega menu and other navigation trees.
Example ​
buildCategoryMenuLink(category, categoryTree)
buildProductLanguagePath() ​
buildProductLanguagePath: (
path
) =>string
Parameters ​
• path: string
product path that is provided by the product response to redirect after a language switch
Returns ​
string
product path that is then navigated to
Description ​
Function for wrapping the product language path.
Example ​
buildProductLanguagePath('')
getCategoryUrlFromRoute() ​
getCategoryUrlFromRoute: (
path
) =>string
Parameters ​
• path: string
Returns ​
string
Description ​
Used to generate the category path inside the mega menu and other navigation trees.
Example ​
getCategoryUrlFromRoute('')
isOpen ​
isOpen:
Ref
<boolean
>
switchLocale() ​
switchLocale: (
language
) =>Promise
<void
>
Parameters ​
• language: string
Returns ​
Promise
<void
>
Description ​
Function for switching app locale.
Example ​
switchLocale('en')
toggle() ​
toggle: (
value
?) =>boolean
Parameters ​
• value?: boolean
Returns ​
boolean