diff --git a/cuizin/js_src/helpers.js b/cuizin/js_src/helpers.js index 11257dc..1d2bfcf 100644 --- a/cuizin/js_src/helpers.js +++ b/cuizin/js_src/helpers.js @@ -39,6 +39,13 @@ export function getBestMatchingLocale(messages, defaultLocale = 'en') { let bestLocale = defaultLocale; // Get best matching locale - locales.some(locale => (messages[locale] && (bestLocale = locale))); + locales.some((locale) => { + if (messages[locale]) { + bestLocale = locale; + // Stop at first matching locale + return true; + } + return false; + }); return bestLocale; }