web / useLocalization
Function: useLocalization() ​
useLocalization():
object
Defined in: apps/web/composables/useLocalization/useLocalization.ts:6
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('')
createLocalePath() ​
createLocalePath: (
path
,locale
) =>undefined
|string
|RouteLocationResolvedGeneric
Parameters ​
path ​
string
e.g. '/login'
locale ​
string
to be added to the path
Returns ​
undefined
| string
| RouteLocationResolvedGeneric
localized path with the locale prefix if necessary
Description ​
Function for creating a path with a specific locale. (useLocaleRoute or useLocalePath)
Example ​
createLocalePath('/login', 'de');
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
,boolean
>
switchLocale() ​
switchLocale: (
language
,hideMenu
) =>Promise
<void
>
Parameters ​
language ​
"de"
| "en"
hideMenu ​
boolean
= true
Returns ​
Promise
<void
>
Description ​
Function for switching app locale.
Example ​
switchLocale('en')
toggle() ​
toggle: () =>
boolean
Returns ​
boolean