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:
parent
162d344be1
commit
07e72be5bb
1 changed files with 7 additions and 6 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue