functions.js
export const getLocale = (userConfig, knownLocales) => {
//return userConfig.locale;
let result;
for (let i = 0; i < knownLocales.length; i++) {
if (knownLocales[i] === userConfig.locale) {
result = userConfig.locale;
} else {
result = 'en!';
}
return result;
}
//return userConfig.locale;
};
Results:
The second output should be "ru" as it should match the knownLocales[1] as it iterates through the loop.
Disregard the comments in the code.
I have been at this for couple of days. Could someone point me in the right direction please?
Thank you