+ Reply to Thread
Results 1 to 3 of 3

Thread: Language Switching For My Website

  1. #1
    tekkie77's Avatar
    tekkie77 is offline x10Hosting Member tekkie77 is an unknown quantity at this point
    Join Date
    May 2010
    Location
    Y should I tell U?
    Posts
    41

    Language Switching For My Website

    Hi. I was wondering how to make a Language switching bar for my website. If you do not know what I am talking about, use this website as an example: http://theoyun.com/.
    Don't you see how it has language switching items on the top right corner area? I would like to have something similar to that. Thanks if you can help!
    Last edited by tekkie77; 06-14-2010 at 11:38 PM.
    ~Tekkie77
    What I use: Flock, GMail, Thunderbird, GIMP

  2. #2
    smithee's Avatar
    smithee is offline x10Hosting Member smithee is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    NIMBY
    Posts
    45

    Re: Language Switching For My Website

    Just had a look at the source of that website, and it looks to be done using jQuery:

    HTML Code:
    <script type="text/javascript"> 
    //<![CDATA[
        function doTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;var lang=lang_pair.split('|')[1];jQuery.cookie('glang', lang);jQuery('body').translate(lang);}
    //]]>
    </script> 
    I can't tell you much about that as I've never really used it before. However it's meant to be really good, so check out its home page and the plug-ins available for it, and see if there's anything in there that will do the job nicely:

    http://jquery.com/
    http://plugins.jquery.com/

    Here's one that might do the job, but look into it further yourself, as like I said earlier I've never really used it before:

    http://plugins.jquery.com/project/langchange

    And because it's only a plug-in, you'll still need the jQuery package installing onto the server.
    .

    Be nice to nerds. Chances are you’ll end up working for one. - Bill Gates

  3. #3
    shant93 is offline x10 Sophmore shant93 is an unknown quantity at this point
    Join Date
    Mar 2010
    Location
    Montreal
    Posts
    117

    Re: Language Switching For My Website

    if you want a more, how should I put this, "graspable" solution, I basically have on my website a regular set of links that keep the $_GET for section and page, while changing the actual .php file.

    Basically, that website (http://0x31.x10hosting.com/devcomm) is separated into language, then section, then page.
    So a page would be, say, [LANG].php?id=[CATEGORY]&sid=[PAGE]

    So if my link looks like this (see below) it will lead me to the equivalent page in another language.
    Code:
    <a href="./en.php?id="<?php echo($_GET['id'] . "&sid=\"" . $_GET['sid']"); ?>" />

+ Reply to Thread

Similar Threads

  1. Replies: 9
    Last Post: 11-26-2009, 10:48 AM
  2. asking about website language
    By ali-med in forum Free Hosting
    Replies: 5
    Last Post: 09-30-2009, 06:13 AM
  3. Website language
    By eminemix in forum Free Hosting
    Replies: 1
    Last Post: 10-04-2008, 10:47 AM
  4. Multi-Language WebSite
    By DarkDragonLord in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 11-09-2007, 12:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers