CheckIfLanguageFileExists() публичный статический Метод

Checks if language file exists.
public static CheckIfLanguageFileExists ( string language ) : bool
language string /// If set to true language. ///
Результат bool
Пример #1
0
    /// <summary>
    /// Returns a list with all the available languages
    /// </summary>
    /// <returns></returns>
    public static List <CultureInfo> GetAvailableLanguages()
    {
        List <CultureInfo> availableLanguages = new List <CultureInfo>();

        CultureInfo[] cultureInfos = CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures);
        foreach (CultureInfo info in cultureInfos)
        {
            if (LocFileUtility.CheckIfLanguageFileExists(info.Name))
            {
                availableLanguages.Add(info);
            }
        }
        return(availableLanguages);
    }
Пример #2
0
    /// <summary>
    /// Checks the available languages.
    /// </summary>
    public static void CheckAvailableLanguages(List <CultureInfo> availableLanguages, List <CultureInfo> notAvailableLanguages, List <string> notAvailableLanguagesEnglishNames)
    {
        availableLanguages.Clear();
        notAvailableLanguages.Clear();
        notAvailableLanguagesEnglishNames.Clear();

        CultureInfo[] cultureInfos = CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures);
        foreach (CultureInfo info in cultureInfos)
        {
            if (LocFileUtility.CheckIfLanguageFileExists(info.Name))
            {
                availableLanguages.Add(info);
            }
            else
            {
                notAvailableLanguages.Add(info);
                notAvailableLanguagesEnglishNames.Add(info.EnglishName);
            }
        }
        notAvailableLanguagesEnglishNames.Sort();
    }