Add locale from country ISO util

This commit is contained in:
Vortrex
2022-09-29 11:15:02 -05:00
parent f3f2dd0e7d
commit 4f2c158192

View File

@@ -296,3 +296,15 @@ async function translateMessage(messageText, translateFrom = getGlobalConfig().l
}
// ===========================================================================
function getLocaleFromCountryISO(isoCode) {
for (let i in getLocales()) {
for (let j in getLocales()[i].countries) {
if (toLowerCase(getLocales()[i].countries[j]) == toLowerCase(isoCode)) {
return getLocales()[i].id;
}
}
}
}
// ===========================================================================