Heya all,
and thank you for your amazing work on drupal and the internationalization module, it's a life saver for all us europeans out there (and the rest of the non-english world)
I have a small quirk to report:
when creating a user menu, and linking it to a translated page with an alias, for example:
- creating a node and it's translation, aliasing them to "en/portfolio" and "fr/portfolio" (creating 2 localized versions of the page)
- creating then a user menu item linking to "portfolio" (so this way you can have a menu that links to the localized version of the page)
the i18n module (or maybe the l() function in common.inc) does not append class="active" to the active page.
- not having a translated version works ok.
- linking to en/portfolio or fr/portfolio works ok, but does not make it translated anymore, ie. the item always links to the defined version of the page, whatever the language is set to.
This said, I find the constraint of prepending en/ or fr/ to an alias a bit counter-intuitive, it would be better imho to define the alias on a common dialog,
not language dependent, and also display on the "admin>contents" page only one entry, as opposed to the 2 separate entries displayed currently.
Cheers !
Comments
Comment #1
astroboy commentedany help about the class="active" part guys ?
That would be really appreciated.
Comment #2
David Lesieur commentedI used to have the same problem. You can work around this problem with a small patch and by creating separate menus for each language. Block visibility settings will allow you to control which menu to show according to the url's language component (en/* or fr/*). Unfortunately, this workaround means your language-specific menu items cannot be in the Navigation menu...
See http://drupal.org/node/17829#comment-29208 for the patch and more details.
With language-specific menus, you'll be able to put the language component in the path of each menu item. When the item is later displayed through function l(), its path will match the url and properly be assigned the "active" class.
I hope this helps.
Comment #3
jose reyero commentedComment #4
mardy78 commentedI'm raising again the priority of the issue, because there's another aspect to take into account, other then the class: expanded items.
If you have an internationalized menu item with children, drupal won't recognize it as active, and therefore won't show the children. :-(
Comment #5
David Lesieur commentedBTW, if you do as described in #2, children will show up as expected. This is still a workaround though.
Comment #6
Anonymous (not verified) commentedAnother solution is shown in http://drupal.org/node/41629#comment-73214. The solution hacks the core. It establishes, that the menu-path can be defined "generic" like e.g. "mypath" while the system paths can be aliased "localized" like e.g. "en/mypath". The link is established and active-menu and collaps/espand works.
bernhard
Comment #7
jose reyero commentedI think we better do the follow up here, http://drupal.org/node/41629, where people are suggestins some solutions..
So marking this one -though posted before the other one- as duplicated.
Btw, I've added a note in the readme about the meny system not playing nice with path aliases containing language prefixes