Jump to content

Détection de langue selon paramètrage navigateur


Recommended Posts

  • 4 months later...

Hello,

Pour ma boutique j'ai modifié le fichier /class/tools.php aux alentours de la ligne 110 pour ajouter ca (solution bête et méchante qui pourrait être améliorée / croisée avec le nom de domaine, etc...) :

$langs=explode(",",$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
           $myLang = substr($langs['0'], 0, 2);

           if ($myLang == 'fr') {
               $array[0] = 'fr';
           } elseif ($myLang == 'es') {
               $array[0] = 'es';
           } elseif ($myLang == 'de') {
               $array[0] = 'de';
           } else {
               $array[0] = 'fr';
           }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...