Ejemplo n.º 1
0
 public static string GetLanguageDisplayName(LanguageNames languageName)
 {
     switch (languageName)
     {
         case LanguageNames.ChineseSimplified:
             return "Simplified Chinese";
         case LanguageNames.ChineseTraditional:
             return "Traditional Chinese";
         case LanguageNames.PortugueseBrazilian:
             return "Brazilian Portuguese";
         case LanguageNames.SpanishSouthAmerica:
             return "South America Spanish";
         default:
             return languageName.ToString();
     }
 }
Ejemplo n.º 2
0
        public static List<string> GetMissingKeys(string englishFilePath, LanguageNames languageName)
        {
            if (languageName == LanguageNames.English)
            {
                return null;
            }
            if (!ValidateTranslationFile(englishFilePath))
            {
                return null;
            }

            string validatingFilePath = englishFilePath.Replace("English", languageName.ToString());

            if (!ValidateTranslationFile(validatingFilePath))
            {
                return null;
            }

            List<string> originalKeys = GetTranslationKeys(englishFilePath);
            List<string> validatingKeys = GetTranslationKeys(validatingFilePath);
            List<string> missingKeys = new List<string>();

            if (validatingKeys == null || validatingKeys.Count == 0)
            {
                return originalKeys;
            }
            else
            {
                foreach (string key in originalKeys)
                {
                    if (!validatingKeys.Contains(key))
                    {
                        missingKeys.Add(key);
                    }
                }
            }

            return missingKeys;
        }
 public string GetLanguageCode(LanguageNames lanName)
 {
     return(GetLanguageCode(lanName.ToString()));
 }
Ejemplo n.º 4
0
 /// <inheritdoc/>
 public string GetLocaleString(LanguageNames languageName)
 => ResourceLoader.GetForCurrentView().GetString(languageName.ToString());