View Full Version : using language files

08-11-2007, 01:07 PM
I have a script which is in English, but i need this script to show both English and German.

the English language already has a language file ( english.php ), so i am going to translate all the English wording to German ( german.php )

so my question is how can i select the language file,
i am going to let the user select the language via a flag image

so when the user clicks on there country flag it will change the site to the requested language etc etc

i want to use separate language files

but how ?

Thanks MrK

08-11-2007, 01:43 PM
You could do something like:

<?php session_start(); ?>
<a href="index.php?lang=eng"> English </a> <a href="index.php?lang=ger"> German </a>

if($_GET['lang'] == 'eng') $lang = 'english';
if($_GET['lang'] == 'ger') $lang = 'german';
} elseif (!empty($_SESSION['lang'])){
$lang = $_SESSION['lang']
if ($lang != 'english' && $lang != 'german'){
$lang = 'english';

$_SESSION['lang'] = $lang;
include $lang.'.php';

08-11-2007, 01:54 PM
thank you, i will give this a try later after work

thanks again


08-20-2007, 09:26 PM
Thanks for the help , got it working

:thumbsup: :eek:


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum