Multilangue

X.0mar Messages postés 59 Date d'inscription   Statut Membre Dernière intervention   -  
X.0mar Messages postés 59 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
je suis entrain de créer un site e-commerce et je devrais traduire tout mes pages en Français par défaut => Anglais, Italien et Germant
jusque ici tout va bien, apparat que quand je affiche ma page index.php il affiche un petit problème le suivant :

Notice: Undefined index: lang in C:\wamp\www\ARTISANA\decide-lang.php on line 2

Notice: Undefined index: lang in C:\wamp\www\ARTISANA\decide-lang.php on line 5

Notice: Undefined index: lang in C:\wamp\www\ARTISANA\decide-lang.php on line 8

Notice: Undefined index: lang in C:\wamp\www\ARTISANA\decide-lang.php on line 11

ET MA PAGE BIEN SUR et après avoir cliquer sur un drapeau tout ira bien, il faut choisir une langue par défaut surement...

le fichier decide-lang.php est comme suivant :

<?php
if ($_GET['lang']=='fr') { // si la langue est 'fr' (français) on inclut le fichier fr-lang.php
include('lang/fr-lang.php');
}
elseif ($_GET['lang']=='en') { // si la langue est 'en' (anglais) on inclut le fichier en-lang.php
include('lang/en-lang.php');
}
elseif ($_GET['lang']=='it') { // si la langue est 'it' (italien) on inclut le fichier it-lang.php
include('lang/it-lang.php');
}
elseif ($_GET['lang']=='ge') { // si la langue est 'ge' (germany) on inclut le fichier ge-lang.php
include('lang/ge-lang.php');
}
else { // si aucune langue n'est déclarée on inclut le fichier fr-lang.php par défaut
include('lang/fr-lang.php');
}

?>

c'est vraiment important merci
Omar

2 réponses

Valarauco Messages postés 16 Date d'inscription   Statut Membre Dernière intervention   21
 
Les simples cotes '*' sont pour les caractères.
Il faut mettre des doubles cote : "fr"
0
X.0mar Messages postés 59 Date d'inscription   Statut Membre Dernière intervention  
 
merci beaucoup et a plus.
0