Using a CSS File for site localization

前端 未结 3 1937
灰色年华
灰色年华 2021-02-09 02:42

I\'m creating a website with ASP.net MVC 2.0 which uses two different languages (English and Persian). I want to have two different layouts for these languages, English has a le

3条回答
  •  灰色年华
    2021-02-09 03:01

    Not sure if this is what you ar elooking for, but I did this a few years back in VBScript. Not ideal, but it works for me:

    Figure out the language:

    <%
    Dim sLanguage
    sLanguage = Request.QueryString("lang")
    
    Dim userLocale
    userLocale=Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
    
    Dim sDomain
    sDomain = Request.ServerVariables("HTTP_HOST")
    
    Dim languages
    languages = Split(userLocale, ",", -1)
    
    
    ...
    

    Set the style sheet...

    <% select case MasterLanguage
        case "PORTUGUESE"%>
            
            
            
    <%
    case "SIMPCHINESE"
    %>
            
            
            
    <%
    

    I can post more snippets if this is helpful.

提交回复
热议问题