문제

I have a website built in mvc3. I want to have an image of the Spanish flag and then when clicked on the site language changes to Spanish. I have not developed the site but i notice it is using CurrentUICulture. Im guessing i can trigger a function and then store the culture in a session variable and set this as the culture?

  private string CultureString
    {
        get
        {
            return Thread.CurrentThread.CurrentUICulture.Name;
        }
    }
도움이 되었습니까?

해결책

That sounds good to me ... the only thing you might want to consider is whether people should be able to share links / bookmark the localized versions of your site. If you want that feature, you should put the culture in either the path or the query string, ie /home/index/es-us, or home/index?locale=es-us.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top