Ecom Posted January 13, 2010 Share Posted January 13, 2010 Bonjour,Ma boutique est forcée en anglais par défaut. Lorsque je me connecte avec Firefox, Safari, j'arrive bien sur ma "home" en anglais. En revanche sous IE, j'arrive sur ma "home" en français. Y a t'il à forcer quelque chose pour IE en plus?Merci pour votre aide.Bonne journée. Link to comment Share on other sites More sharing options...
Ecom Posted January 13, 2010 Author Share Posted January 13, 2010 J'ai un peu avancé sur le problème mais je ne suis pas satisfait du résultat.Finalement j'ai désactivé le français dans le backoffice (Tools), j'ai bien maintenant l'anglais par défaut sous IE.En revanche, le backoffice est en anglais.Y'a t'il une autre solution pour avoir par défaut:Le front en AnglaisLe back en francais.Merci à tous. Link to comment Share on other sites More sharing options...
Peha Posted January 13, 2010 Share Posted January 13, 2010 Bonjour,voici l'astuce de Tomerg3, qui fonctionne chez moidans /classes/Tools.php (on PS 1.2) /* Automatically detect language if not already defined */ if (!$cookie->id_lang AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); if (Validate::isLanguageIsoCode($array[0])) { $lang = new Language(intval(Language::getIdByIso(strval($array[0])))); if (Validate::isLoadedObject($lang) AND $lang->active) $cookie->id_lang = intval($lang->id); } } Il faut commenter ce bout de code, ce qui donne : /* Automatically detect language if not already defined if (!$cookie->id_lang AND isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); if (Validate::isLanguageIsoCode($array[0])) { $lang = new Language(intval(Language::getIdByIso(strval($array[0])))); if (Validate::isLoadedObject($lang) AND $lang->active) $cookie->id_lang = intval($lang->id); } } */ Link to comment Share on other sites More sharing options...
Ecom Posted January 13, 2010 Author Share Posted January 13, 2010 Merci Peha, Ca fonctionne bien, je l'ai juste un peu améliorer pour qu'il efface le cookie existant ligne précédente (ligne 101).Bonne soirée.* Change language in cookie while clicking on a flag */ static public function setCookieLanguage() { global $cookie;$cookie->id_lang = NULL; /** ajout pour effacer le cookie **/ Link to comment Share on other sites More sharing options...
Peha Posted January 13, 2010 Share Posted January 13, 2010 Je pense que c'est inutile,car l'utilisateur qui n'a pas accès au BO n'a aucun moyen de faire un cookie Fr (si tu as supprimé le block langue)en faisant ça, chaque fois que tu vas dans ton BO tu dois repasser en Fr (ce qui est un peu relou.)pa. Link to comment Share on other sites More sharing options...
Ecom Posted January 13, 2010 Author Share Posted January 13, 2010 Tu a raison mais j'ai l'administrateur du site qui gère le backoffice en francais et qui consulte toujours le front en anglais.Voila pourquoi je suis obligé de faire cela.Très bonne soirée. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now