Exemple #1
0
    private void GetAvailableLanguages()
    {
        List <Language> lstLanguage = LocalizationSqlDataProvider.GetPortalLanguages(PortalID);

        if (lstLanguage.Count < 1)
        {
            ltrNav.Visible = false;
        }
    }
    private void AddLanguage()
    {
        int             PortalID         = GetPortalID;
        List <Language> lstLanguage      = LocalizationSqlDataProvider.GetPortalLanguages(PortalID);
        List <Language> lstLanguageFlags = LocaleController.AddNativeNamesToList(AddFlagPath(LocalizationSqlDataProvider.GetPortalLanguages(PortalID), GetApplicationName));

        if (lstLanguage.Count < 1 || lstLanguageFlags.Count < 1)
        {
            languageSetting.Visible = false;
        }
        else
        {
            var query = from listlang in lstLanguage
                        join listflag in lstLanguageFlags
                        on listlang.LanguageCode equals listflag.LanguageCode
                        select new
            {
                listlang.LanguageCode,
                listflag.FlagPath
            };
            StringBuilder ddlLanguage = new StringBuilder();
            string        cultureCode = GetCurrentCulture();
            ddlLanguage.Append("<ul id=\"languageSelect\" class=\"sfListmenu\"");
            ddlLanguage.Append(">");
            foreach (var item in query)
            {
                if (item.LanguageCode == cultureCode)
                {
                    ddlLanguage.Append("<li value=\"" + item.LanguageCode + "\" class='languageSelected'>");
                    ddlLanguage.Append(item.LanguageCode + "-" + "<img src=\"" + item.FlagPath + "\">");
                    ddlLanguage.Append("</li>");
                }
                else
                {
                    ddlLanguage.Append("<li value=\"" + item.LanguageCode + "\">");
                    ddlLanguage.Append(item.LanguageCode + "-" + "<img src=\"" + item.FlagPath + "\">");
                    ddlLanguage.Append("</li>");
                }
            }
            ddlLanguage.Append("</ul>");
            languageSetting.Text = ddlLanguage.ToString();
        }
    }
Exemple #3
0
    private void LoadFlags(List <LanguageSwitchKeyValue> lstSetting)
    {
        List <Language> lstLanguage = LocaleController.AddNativeNamesToList(AddFlagPath(LocalizationSqlDataProvider.GetPortalLanguages(PortalID), GetApplicationName));

        BindFlags(lstLanguage, lstSetting);
    }
Exemple #4
0
    public static List <Language> GetAvailableLanguages(string baseURL, int PortalID)
    {
        List <Language> lstLanguage = LocaleController.AddNativeNamesToList(AddFlagPath(LocalizationSqlDataProvider.GetPortalLanguages(PortalID), baseURL));

        return(lstLanguage);
    }