2

Magento language switching invalid:

  1. Click Chinese : http://127.0.0.1/porto/vendors/index/login/?___store=english&___from_store=cn => display English
  2. Click English : http://127.0.0.1/porto/vendors/index/login/?___store=english&___from_store=cn => Display Chinese

My store configuration is set to:

  • default config: Chinese
  • main website: Chinese
  • english store: English
  • chinese store: Chinese
2

Use short code like en for english. It have to match your lang folder code

2
  • This is wrong. The so called "language switch" is a store switch and you can use whatever store code the store has. The language is defined by the store, not the short code. May 26 '15 at 10:28
  • use en and cn , same is May 27 '15 at 2:33
2

Make sure sessions work, which means cookies should work. Not all browsers like localhost or up addresses for cookies.

If everything seems to be in order, follow the code from Mage:: run with a debugger or your mind. It should not take long before Magento has selected the store to run.

If the correct store is run, but the language is incorrect, I suspect you are using a full cache implementation that had not been told yet to never cache pages with the store parameter in the URL.

If it selects the wrong store, you may already have seen why. Most likely culprit is a rewrite by an extension or a auto loader override in app/code/local/Mage.

If you still can't figure it, follow up with more details about what you've found out with these tests.

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