mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-30 13:03:29 +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,
|
||||
];
|
||||
|
||||
const localeTargetLanguages = localeMatch(
|
||||
locales,
|
||||
translationTargetLanguages.map((l) => l.code.replace('_', '-')), // The underscore will fail Intl.Locale inside `match`
|
||||
'en',
|
||||
);
|
||||
const localeTargetLanguages = () =>
|
||||
localeMatch(
|
||||
locales,
|
||||
translationTargetLanguages.map((l) => l.code.replace('_', '-')), // The underscore will fail Intl.Locale inside `match`
|
||||
'en',
|
||||
);
|
||||
|
||||
function getTranslateTargetLanguage(fromSettings = false) {
|
||||
if (fromSettings) {
|
||||
|
@ -21,7 +22,7 @@ function getTranslateTargetLanguage(fromSettings = false) {
|
|||
return contentTranslationTargetLanguage;
|
||||
}
|
||||
}
|
||||
return localeTargetLanguages;
|
||||
return localeTargetLanguages();
|
||||
}
|
||||
|
||||
export default getTranslateTargetLanguage;
|
||||
|
|
Loading…
Add table
Reference in a new issue