selectedLanguage(): TLocaleIsoUnderscore¶
The selectedLanguage
method allows to get a currently selected language in the shop.
Returned value¶
A returned value has a type of TLocaleIsoUnderscore.
Example¶
In this example we make a TranslationsApi
call to get a currently selected language in the shop.
useStorefront(async (storefront) => {
const translationsApi = await storefront.getApi('TranslationsApi');
const currentlySelectedLanguage = translationsApi.selectedLanguage();
});