Author Topic: muli language web site creation  (Read 4290 times)

0 Members and 1 Guest are viewing this topic.

Offline Dimka19

  • Pre-Newbie
  • Posts: 2
    • View Profile
muli language web site creation
« on: June 16, 2003, 05:41:05 PM »
Hello People need your advice
4image has a quite sistem of switching between langages it is possible to use it on a custom template?
 
Code: [Select]

for examle i ve created a new template "about me"
http://www.mysite.com/home/index.php?template=aboutme


lets say the info is in english and also translated in  several langages
Code: [Select]

about_en.inc  -info in english
about_de.inc  -info in deutsch
about_jp.inc   -info in japaneese

thats what i've put in the body this only when the template is set in english by default

Code: [Select]

<?
if ($template== aboutme) { include "{template_url}/incl/about_en.inc"; }
elseif ($l== english) { include "{template_url}/incl/about_en.inc"; }
elseif ($l== deutsch) { include "{template_url}/incl/about_de.inc"; }
elseif ($l== japanese) { include "{template_url}/incl/about_jp.inc"; }
 ?>


i ve added javascript that will switch the langages
Code: [Select]

function go1(){
if (document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value != "none") {
location = document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value
}
}
//-->
</script>
                <script language="JavaScript" type="text/javascript">
<!--
document.write('<form name="selecter1"><select name="select1" size=1>');
document.write('<option value=none>Select your language');
document.write('<option value=none>--------------------');
document.write('<option value="{current_address}?l=deutsch">deutsch');
document.write('<option value="{current_address}?l=english">english');
document.write('</select>');
document.write('<input type="button" value="Go" onclick="go1()">');
document.write('</form>');


but it always turns me to an index.php?l=(chousen language)

..i am not sure if this correct thou  {current_address}?l=deutsch

What i want is when i link on the page ?template=aboutme i se my text in english ,when i select deutsch it will ad variable $l ==deutsch so that script will include a deutsch text ito my template.


Or maybe it is easyer to add more varibls to a language files for eq enlish
$lang['about_en'] = "text here";

and then put it on the template? somehow ... {lang_about_en}??


Any Advices are welcome
Thanks :wink:

Offline Apollo13

  • Addicted member
  • ******
  • Posts: 1.093
    • View Profile
muli language web site creation
« Reply #1 on: June 19, 2003, 12:00:52 PM »
well i think its better u use more lang[''] tags.