There is a much easier way to achieve this. I write this for Magento 1.4x, but with a little modification it is achievable for every older Magento version.
If you look into /app/code/core/Mage/Core/Model/Store.php you see following function:
public function getCurrentUrl($fromStore = true)
So without changing any core code grab /app/design/frontend/base/default/template/page/switch/languages.phtml
Yeah, I’ve searched high and low for a way to remove the `?___from_store=` parameter from SEF URLs. Is there anyone out there that can shed some light on this for me? Could the URL Rewrite be used? New install of Magento v1.4.1.1.
Ran into the same issue. If using language (store view) specific url keys changing language via the switcher only changes the store view code but not the url-key, which results in 404. This is a huge oversight as it invalidates the whole point of using different url keys for different languages.
The only workarounds i can think of is either create custom URL rewrite rules to force the proper url key or to automatically open the home page when the language is changed. The first option can be time intensive if the number of categories is significant. The second one makes sense since users don’t jump back and forth between the languages very often, but it feels like a half-baked solution somehow.
Waah, I have the same damn problem and it is really annoying me like hell, especially my customer who runs the show. I tried DerAndrejs solution, but it just works partially (thanks anyways, dude!).
There is a much easier way to achieve this. I write this for Magento 1.4x, but with a little modification it is achievable for every older Magento version.
If you look into /app/code/core/Mage/Core/Model/Store.php you see following function:
public function getCurrentUrl($fromStore = true)
So without changing any core code grab /app/design/frontend/base/default/template/page/switch/languages.phtml