Module: lang-switcher

Language switcher component.

Source:

Example

<LangSwitcher />

Methods

(function) created()

Lifecycle hook: Called after the component has been created. Sets the locale in the store to the value in local storage or 'en-US'. Sets the language in Quasar to English. Retrieves the locale options from the server and sets the locale in the store to the value in local storage or 'en-US'. Calls the localeChanged method.

Source:

(method) localeChanged()

Asynchronously changes the locale of the application. If the locale options are not available or empty, the function returns early. The function sets the selected locale in the local storage and updates the i18n locale. It also updates the langId in the store and makes API requests to update the localization messages and Quasar language. Finally, it retrieves the routes from the server and updates the store. If an error occurs, it reverts to the English locale and displays the error message.

Source:

(method) revertToEnglish()

Reverts the language to English. Sets the locale in the store, local storage, and i18n to 'en-US'. Sets the langId in the store to 1. Sets the language in Quasar to English.

Source: