web / useLocalization
Variable: useLocalization() ​
constuseLocalization: () =>object
Defined in: apps/web/app/composables/useLocalization/useLocalization.ts:6
Returns ​
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) =>string|RouteLocationResolvedGeneric|undefined
Parameters ​
path ​
string
e.g. '/login'
locale ​
string
to be added to the path
Returns ​
string | RouteLocationResolvedGeneric | undefined
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