Locale Switcher
Locale switcher
Demo
API
Tag
Name | Description |
<aui-locale-switcher>
|
Custom Element to show the current locale setting and allow a user to change it to another configured locale. |
Attributes
Name | Value | Required | Description |
optionslist |
Stringified JSON array of option objects. See Guidelines below. |
||
l10npath |
string |
Path to the app's localization file relative to |
|
icononly |
boolean |
When present, only show the international (world) icon. |
|
user |
String |
Stringified JSON of user object, see Guidelines below. |
|
skylabversion |
string |
|
The current version of skylab-sdk used in your project. This will be deprecated in the near future. |
Properties
Name | Value | Required | Description |
---|---|---|---|
optionsList |
Stringified JSON array of option objects. See Guidelines below. |
||
l10nPath |
string |
Path to the app's localization file relative to |
|
iconOnly |
boolean |
When present, only show the international (world) icon. |
|
user |
JSON |
Set this to user object JSON, see Guidelines below. |
|
requestCurrentAccessToken |
Function |
Function that returns a Promise resolving to |
Events
Name | Detail | Description |
s-localeselect
|
|
Fired when a locale is selected. The event detail contains the selected locale, messages with key mapped to translations, and an array of failed files with url and status codes and text. |
Demo
API
Tag
Name | Description |
<AuiLocaleSwitcher>
|
Custom Element to show the current locale setting and allow a user to change it to another configured locale. |
Props
Name | Value | Required | Description |
optionsList |
Stringified JSON array of option objects. See Guidelines below. |
||
l10nPath |
string |
Path to the app's localization file relative to |
|
iconOnly |
boolean |
When present, only show the international (world) icon. |
|
user |
JSON |
Set this to user object JSON, see Guidelines below. |
|
requestCurrentAccessToken |
Function |
Function that returns a Promise resolving to |
|
onS-localeselect
|
Function |
Handles the s-localeselect event that fires when a locale is selected.
|
Skylab React links
Guidelines
Options list
The options list sets the available locales.
User object
If your app doesn't already have access to the Avalara Identity user data, then use AUI Identity to get it. API for <aui-locale-switcher>
user data is
provided below.
or data can be assigned as attribute using stringified JSON
Design
Design resources can be found on the Skylab design documentation site: skylab.avalara.com