mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-25 01:24:36 +00:00
Update checkLanguageCode
This commit is contained in:
@@ -165,9 +165,10 @@ Check whether a language code is supported by Intl
|
||||
*/
|
||||
exports.checkLanguageCode = lang => {
|
||||
try {
|
||||
"a".localeCompare("a", lang);
|
||||
Intl.Collator(lang);
|
||||
return true;
|
||||
} catch(e) {
|
||||
console.warn(`Warning: ${lang} is not a valid language code.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user