Multiple languages

Results 1 to 5 of 5

Thread: Multiple languages

  1. #1
    Pat Daly Guest

    Default Multiple languages

    I&#039;m trying to develop a website that can support 2 or more different languages. I want to be able to design 1 instance of the web site that dynamically inserts different languages depending on the language the user selects on the home page. I have searched the net for some ideas but can only come up with a few ideas of my own. <BR>I was thinking of storing the text in a database and displaying the language equilivent on the web page. I dont believe this is a good option.<BR>Or maybe I could use a dynamnic include feature.<BR>Any ideas or resources would be much appeciated. I&#039;m sure this problem is not new to web developers.<BR>Thanxs

  2. #2
    Tooooozious Guest

    Default RE: Multiple languages

    you talking about client side code? if so then ask the user what language they&#039;d like to use on the siet, smack it in a session variable then do a massive if statment everytime you write a bit of code in JS or Client side VBs. That&#039;s what i&#039;d do coz i&#039;m a lazy git.

  3. #3
    Rhino Guest

    Default RE: Multiple languages

    Yes, that is the way to go. One more thing though. If you name your database fields along the lines of FRStrCompanyName, DEStrCompanyName etc, you can then simply do this:<BR><BR>Response.Write rs(Session("LanguageCode") & "StrCompanyName")

  4. #4
    Join Date
    Dec 1969

    Default RE: Multiple languages

    I&#039;m also developing an multilingual website and came up with another idea:<BR><BR>On the top of the page (in an INCLUDE file) I create an scripting.dictionary object. To this dictionary I add the lines I want to display:<BR><BR>dim dictLang <BR>set dictLang = CreateObject("Scripting.Dictionary")<BR><BR>&#039; English:<BR>dictLang.Add "en_home_title", "Welcome to my website"<BR><BR>&#039;German:<BR>dictLang.Add "ge_home_title", "Wilkommen auf..."<BR><BR>I do this for all the lines I need to response.write. Then when I want to write an line I use the following code:<BR><BR>&#060;%Response.Write dictLang.Item(strLang &"_home_title")%&#062;.<BR><BR>strLang is depending on the selected language "en" or "ge" or ..<BR><BR>The "dynamic pages" are built like this, but for the (few) static pages whith lots and lots of text I created an page for every language which is in its own directory (EN/GE etc.) The directories are then choosen dynamically, according to the value of strLang.<BR><BR>My inlcude file with the languages is over 600 lines and I don&#039;t notice any performance problems. <BR><BR>However, if you&#039;re gonna need an include file with thousands of lines and many, many visitors a day you&#039;d probably be better off using databases. But for me this solution works fine. <BR>One more thing: you have to close the dictionary on every page (in the footer??) using<BR><BR>function cleanup()<BR> cleanup = dictLang.RemoveAll <BR> set cleanup = Nothing<BR>end function<BR><BR>Maybe this &#039;ll give you something to start with.<BR><BR>Peter.<BR><BR><BR><BR><BR>

  5. #5
    Join Date
    Dec 1969

    Default RE: Multiple languages

    Thanks Peter <BR>Thats an interesting idea. Should do the job for me.<BR>C ya

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts