Is this considered good practice

Results 1 to 2 of 2

Thread: Is this considered good practice

  1. #1
    Join Date
    Dec 1969

    Default Is this considered good practice

    Hi,<BR><BR>Just a quick(?) question:<BR><BR>I&#039;m creating an site which has to support multiple languages. I therefore include an file in all my asp pages. (inclang.asp)<BR><BR>In this file I create an Scripting.Dictinary Object and add the following:<BR>&#039;-- English<BR>dictLanguage.add "english_Welcometext_1", "Hi, welcome to my site"<BR><BR>&#039;--German<BR><BR>dictLanguage.add "german_Welcometext_1", "Willkommen auf meine ..."<BR><BR>etc etc.<BR><BR>For all the text in the asp pages I&#039;ve created an entry in the dictionaryobject. Then I use:<BR>Response.Write dictLang.Item(Session("lang") &"_Welcometext_1") to display the correct language.<BR><BR>The inclang.asp file is approx. 500 lines.<BR><BR>Can this be considered good practice, or should I use an different method? When I test, everything works fine but I don&#039;t know what will happen if there are 100 of even more users on the site.<BR><BR>Thanks in advance for every response.<BR><BR>Peter

  2. #2
    Join Date
    Dec 1969

    Default RE: Is this considered good practice

    I think it is a good practice but the only problem is that your file is approx. 500 lines so in each and every .asp file you include your file then the ASP engin MUST interpret the code. Remeber that you&#039;re ASP in being interpreted not compile and it always takes more time. If you have a small site this approach is sufficient otherwise consider the database approach OR COM objects which are way faster.<BR><BR>You could use the application variable <BR>Or <BR>Could just use cookies with the language and on the first page you retrieve this cookie then you pass it along via the QueryString<BR><BR>

Posting Permissions

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