Hi - first off - great module - came just at the right time for me :)
I'm posting this here, however, feel free to move it to another module.
Basically the problem is this:
The language switcher switches to /langcode/node/xxx rather than /langcode/mypath/myalias when used with i18n for node translation since hook_translation_link_alter returns un-aliased node links.
I don't know whether this is a problem with i18n or a problem in general or specifically a problem with this module and I don't have time right now to check - however it is an easy fix in this module, and arguably this module should perform the aliasing on links given it anyway.
Basically a simple fix.
Take out the check_url(url($path)) at line 52 and add check_url(url($lang_option['href'], array('language' => $lang_option['language'])) at line 71 after translation_link_alter has returned its results.
This also fixes a problem with translated node urls being incorrectly attached to the end of a path alias - i.e.
en/mypathalias/mynodetitle became fr/mypathalias/mynodetitle/node/25
Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| lang_dropdown.patch | 1.26 KB | subspaceeddy |
Comments
Comment #1
mohammed j. razemThanks for patch! it's committed to the dev snapshot.
You managed to solve a problem that was bothering me when building translation URLs. This is exactly what was needed :)
Comment #2
not_Dries_Buytaert commentedJust for the record, I confirm this issue also occurs without the i18n module.
Comment #3
mohammed j. razem