Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Script to change language (no auto redirect)?

  1. #1
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Script to change language (no auto redirect)?

    Could someone please point me in the direction of a good script that will change the langauge of the website? The only results I get on Google are for detecting the browser language and auto redirecting. I would like for the user to select their own language then have that language remembered during the visit and for the next time they come back. I am not sure about the best way to go about doing this. Any help and/or suggestions would be great.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    That's crazy.

    Javascript can change certain things on a page, but changing the language is changing the entire page.

    You could, I suppose, use javascript to rewrite the whole page, but that's tedious and would be a memory issue as well as create a rather large script.

    Definitely use a redirect here and have seperate pages for different languages as well as using cookies to store the language choice.

    How do you plan to have the user select his/her language?


    Additionally, if you mean to imply that you want javascript to translate the page, then that's not gonna happen, unless you want to program (yes, possible) the translation yourself, which would be insanely complex.
    It didn't sound like you needed this, but did want to note it just in case.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know that I can not use java to change the language itself. I was think that I would have to have a seperate pages with the language. As for the redirect: I meant no auto browser language detect then redirect sript. I have in mind to use a drop down menu as the means of choice.

    Also, Is there a way to use this with a template? Instead of 20 similar pages with the only difference being language. I would rather have a template with the Header, Navbar and footer. The content would be changed with the script.

    Thank you very much for your help and time!

  4. #4
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    You haevn't mentioned the server-side language you are using/going to use in your post.

    As djr33 mentioned in his post using JavaScript alone i don't think it is possible for you to develop a multi-lingual website.

    Are you using any Content Management Systems? Most of the popular CMS supports the method to create multilingual website for example Joomla, PHPNuke, etc

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ah, hmmm.... ok.
    I get it more now.

    Yes, look into server side for this. It would be a great way to use templates.

    You could use CMS or write the php (etc.) yourself... would work very well.

    Redirect is easy... just use php to interpret the form, or perhaps javascript... use a jump menu.... dropdown, click, go... easy as that.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Or you could use cookies to remember the settings....
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  7. #7
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    To be honest I am not familiar with any of the server side languages or content management systems. I will add these items to my list of things to learn.

    I will have a look into my control panel to see what CMS is available for use. However I am not able to do this from my work computer. So in five or so hours I will begin lesson one with CMS.

    Thank you both for the help.

  8. #8
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    These days, you don't need to learn alot about CMS.

    Do you have a web server that supports PHP and MySQL?

    Just unzip the CMS into the folder.

    Do you have web hosting?

    Just upload all the files via FTP.

    The rest is easy, just find out your logon details for MySQL.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  9. #9
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    These days you may not need to know much about CMS but it I think it would help to know CMS as well as the server side languages. I am way behind the power curve and need to catch up.

    As for my host (ImHosted): supports PHP and MySQL.

    I will ask about the MySQL login details. The only login info I see on my account information is the use of FTP, FrontPage, Mail, Control Panel, WebMail and Telnet.

    I downloaded the new beta version of JOOMLA and will begin playing with this.

  10. #10
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by slambam
    I know that I can not use java to change the language itself.
    Java and JavaScript are very different languages.

    I have in mind to use a drop down menu as the means of choice.
    So long as you don't rely on client-side scripting to implement it, fine. However, you must keep in mind that for the menu to be useful, its purpose must be obvious.

    A common means - displaying a series of links at the top of the document naming the language (English, Deutsch, Svenska, etc.) - is perhaps more obvious because the visitor doesn't need to recognise others as the names of languages (for example, whatever would appear first in your menu), only their own.

    For a discussion of issues surrounding multilingual sites, read Jukka Korpela's Techniques for multilingual Web sites. Note that if your browser is configured to prefer one of the alternative representations (German, Finnish, or Swedish), that document will be shown in preference. This isn't based on the interface language of the browser, but rather the actual reading preferences of the user.

    Mike

Bookmarks

Posting Permissions

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