langInfoFromKey function
Resolve Locale information LangInfo through the locale key (es, en). Instead of null, if languageCode not found, returns an empty LangInfo
Implementation
LangInfo langInfoFromKey(String key) {
key = normLocale(key, '-').toLowerCase();
// key = key.replaceAll('_', '-');
if (!kLangMap.containsKey(key)) {
print('Language code not found: $key');
return LangInfo(
'',
'',
key,
'',
);
}
final vo = kLangMap[key]!;
return LangInfo(
vo['nativeName']!,
vo['englishName']!,
key,
vo['emoji']!,
);
}