Language switcher: theme data reference
Reading the data tables. Presence varies by page and state; this is not a requirement to populate every field.
| Field | Type | Meaning | Availability |
|---|---|---|---|
viewModel.languageSwitcher |
object | Language switcher data; check child fields before use. | When the parent is provided; check optional fields. |
viewModel.languageSwitcher.currentIsoCode |
string | Current iso code value supplied for this context. | When the parent is provided; check optional fields. |
viewModel.languageSwitcher.currentLabel |
string | Prepared current display text. | When the parent is provided; check optional fields. |
viewModel.languageSwitcher.currentLanguageId |
number | current language identifier; do not load data with it. | When the parent is provided; check optional fields. |
viewModel.languageSwitcher.isEnabled |
boolean | Whether enabled applies; use for display only. | When the parent is provided; check optional fields. |
viewModel.languageSwitcher.items |
array | Prepared items collection; may be empty. | Items exist when more than one storefront language is enabled; otherwise the array is empty. |
viewModel.languageSwitcher.items[].isActive |
boolean | Whether active applies; use for display only. | Items exist when more than one storefront language is enabled; otherwise the array is empty. |
viewModel.languageSwitcher.items[].isDefault |
boolean | Whether default applies; use for display only. | Items exist when more than one storefront language is enabled; otherwise the array is empty. |
viewModel.languageSwitcher.items[].isoCode |
string | Iso code value supplied for this context. | Items exist when more than one storefront language is enabled; otherwise the array is empty. |
viewModel.languageSwitcher.items[].label |
string | Label value supplied for this context. | Items exist when more than one storefront language is enabled; otherwise the array is empty. |
viewModel.languageSwitcher.items[].languageId |
number | language identifier; do not load data with it. | Items exist when more than one storefront language is enabled; otherwise the array is empty. |
viewModel.languageSwitcher.items[].shortLabel |
string | Prepared short display text. | Items exist when more than one storefront language is enabled; otherwise the array is empty. |
viewModel.languageSwitcher.items[].url |
string | Prepared url URL; use unchanged. | Items exist when more than one storefront language is enabled; otherwise the array is empty. |