Pass two-letter language code
This commit is contained in:
parent
cdd2e8ecb4
commit
18f210eef5
|
@ -500,7 +500,8 @@ export const changeLanguageSuccess = createAction('CHANGE_LANGUAGE_SUCCESS');
|
||||||
export const changeLanguage = lang => async (dispatch) => {
|
export const changeLanguage = lang => async (dispatch) => {
|
||||||
dispatch(changeLanguageRequest());
|
dispatch(changeLanguageRequest());
|
||||||
try {
|
try {
|
||||||
await apiClient.changeLanguage(lang);
|
const langCode = lang.substring(0, 2);
|
||||||
|
await apiClient.changeLanguage(langCode);
|
||||||
dispatch(changeLanguageSuccess());
|
dispatch(changeLanguageSuccess());
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dispatch(addErrorToast({ error }));
|
dispatch(addErrorToast({ error }));
|
||||||
|
|
Loading…
Reference in New Issue