Exemplo n.º 1
0
        private string GetLanguage1Name_NoCache(string inLanguage)
        {
            var name = _lookupIsoCode.GetLocalizedLanguageName(Language1Iso639Code, inLanguage);

            if (name == Language1Iso639Code)
            {
                string exactLanguageMatch;
                if (!_lookupIsoCode.GetBestLanguageName(Language1Iso639Code, out exactLanguageMatch))
                {
                    return("L1-Unknown-" + Language1Iso639Code);
                }
                return(exactLanguageMatch);
            }
            return(name);
        }
Exemplo n.º 2
0
        private string GetLanguageName_NoCache(string inLanguage)
        {
            try {
                if (string.IsNullOrEmpty(Iso639Code))
                {
                    return(string.Empty);
                }

                var name = LookupIsoCode.GetLocalizedLanguageName(Iso639Code, inLanguage);
                if (name == Iso639Code)
                {
                    string match;
                    if (!LookupIsoCode.GetBestLanguageName(Iso639Code, out match))
                    {
                        return($"L{_languageNumberInCollection}-Unknown-" + Iso639Code);
                    }
                    return(match);
                }
                return(name);
            }
            catch (Exception)
            {
                return("Unknown-" + Iso639Code);
            }
        }
Exemplo n.º 3
0
        public static LanguageItem CreateLanguageItem(string code)
        {
            // Get the language name in its own language if at all possible.
            // Add an English name suffix if it's not in a Latin script.
            var menuText    = _lookupIsoCode.GetNativeLanguageNameWithEnglishSubtitle(code);
            var englishName = _lookupIsoCode.GetLocalizedLanguageName(code, "en");

            return(new LanguageItem {
                EnglishName = englishName, IsoCode = code, MenuText = menuText,
                FractionApproved = LocalizationManager.FractionApproved(code)
            });
        }