Language Switching For My Website

tekkie77

New Member
Messages
41
Reaction score
1
Points
0
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:

smithee

New Member
Messages
45
Reaction score
2
Points
0
Just had a look at the source of that website, and it looks to be done using jQuery:

HTML:
<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.
 

shant93

Member
Messages
119
Reaction score
0
Points
16
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']"); ?>" />
 
Top