The <salla-localization-modal> web component shows the menu for the store's available languages and currencies. It consists of a Modal activated by the Button component that shows the menu for the store's available languages and currencies, and that can be customized using the properties' parameters.The <salla-localization-modal> must not be called more than once at the same page.
Available API Endpoints for the Localization component are: Example#
Usage#
Properties#
| Property | Attribute | Description | Type | Default |
|---|
| Language | language | Enabling the current localization attribute, either existing or newly selected | string | 'salla.config.get('user.language_code')' |
| Currency | currency | Enabling the current currency attribute, either existing or newly selected | string | 'salla.config.get('user.currency_code')' |
Methods#
The pre-defined methods allow for calling to call functions built by Salla to carry out certain actvities, such as close / open the modal component or activating the action submit.| Method | Description | Return Type |
|---|
close() | Closes the localization's component | Promise<HTMLElement> |
open() | Opens the localization's component | Promise<boolean> |
submit() | Submits the language/currency data | Promise<void> |
Slots#
The slots makes it customizable to modify certain labels, such as currency & language, as well as adding header & footer extended features.| Slot | Description |
|---|
currency | Replaces currency label with replaceable props which are {name}, {code}, {country_code}. |
language | Replaces language label with replaceable props which are {name}, {code}, {country_code}. |
header | Replaces the top of the modal. |
footer | Replaces the bottom of the modal. |