1
0
Fork 0
mirror of https://github.com/cheeaun/phanpy.git synced 2025-02-21 01:30:42 +03:00

Try delay run localeTargetLanguages

This commit is contained in:
Lim Chee Aun 2024-09-10 12:32:55 +08:00
parent 162d344be1
commit 07e72be5bb

View file

@ -8,11 +8,12 @@ const locales = [
...navigator.languages, ...navigator.languages,
]; ];
const localeTargetLanguages = localeMatch( const localeTargetLanguages = () =>
locales, localeMatch(
translationTargetLanguages.map((l) => l.code.replace('_', '-')), // The underscore will fail Intl.Locale inside `match` locales,
'en', translationTargetLanguages.map((l) => l.code.replace('_', '-')), // The underscore will fail Intl.Locale inside `match`
); 'en',
);
function getTranslateTargetLanguage(fromSettings = false) { function getTranslateTargetLanguage(fromSettings = false) {
if (fromSettings) { if (fromSettings) {
@ -21,7 +22,7 @@ function getTranslateTargetLanguage(fromSettings = false) {
return contentTranslationTargetLanguage; return contentTranslationTargetLanguage;
} }
} }
return localeTargetLanguages; return localeTargetLanguages();
} }
export default getTranslateTargetLanguage; export default getTranslateTargetLanguage;