getLanguageName method
Implementation
String getLanguageName(String localeId, Map<String, String> language) {
String? ret;
switch (languagesDisplayLanguage) {
case LanguagesDisplayLanguage.native:
ret = language['nativeName'];
break;
case LanguagesDisplayLanguage.english:
ret = language['englishName'];
break;
//ToDo: to be supported
// case LanguagesDisplayLanguage.translated:
// ret = language[Constants.languageTranslatedName];
// break;
default:
throw UnsupportedError(
'This language display strategy is not supported');
}
if (ret == null) {
throw UnsupportedError(
'The language $localeId has no translation. Please make a PR or report it.');
}
return ret;
}