0

I have a multi-language website with a language switcher that actually works. If I click on the new language (e.g, Italian) I'm redirected to a new page with the ?___store=it&___from_store=en url extension and the contents are translated.

The problem is that when I follow a link from that page, the new page shows the default - initial - language.

What do you think is going wrong?

edit

Links to other pages are simple <a> tags; is there any function in Magento to build links that consider the selected language?

1 Answer 1

1

the store should be stored in a cookie called "store" as soon as you change from the default store view.

There are a few possibilities what could go wrong here:

  1. The cookie is not saved
  2. The store switch based on the cookie is broken
  3. your web server always redirects to the default store view (sth. like MAGE_RUN_CODE in the webserver config)
3
  • Hi David, thanks a lot for your answer. Actually it seems the cookie is not saved. Can you pls point me to the code where the cookie is set? I customized the language switcher so maybe I broke something there. Btw I don't see any reference to cookies in /var/www/html/vendor/magento/module-store/view/frontend/templates/switch/languages.phtml so maybe I'm not looking at the right code
    – davideghz
    Commented Dec 14, 2016 at 8:40
  • the code, which sets the store code cookie, is in the file app/code/core/Mage/Core/Model/App.php github.com/bragento/magento-core/blob/1.9/app/code/core/Mage/… Commented Dec 14, 2016 at 8:52
  • It finally seems my problem is related to this issue tracked on github github.com/magento/magento2/issues/6404#issuecomment-245608028. I actually still have problems with it, but your answer pointed me to the right direction, thx a lot :)
    – davideghz
    Commented Dec 14, 2016 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.