Localizing Menu Items with Hierarchial Navigation Enabled

Topics: Localization
Editor
Jul 11, 2011 at 10:27 PM

I am looking to localize my navigation on my site. I have enabled Localization, downloaded and enabled all the features of culture picker, and placed the culture picker as a widget on a default layer. When I toggle a page to a different culture, the proper localized content shows up. However I would expect as I navigate to successive pages it would also route them properly for culture as well. This is not happening. Secondly, if I want to localize the menu strings do I have to duplicate the whole navigational structure again? I enabled Localization on Menu, Menu Item, Simple Menu Item but this did not add any new UI elements in order to localize the navigational elements.

 

Appreciate the help as always!

Coordinator
Jul 11, 2011 at 10:41 PM

Did you lok at the advanced menu from the gallery?

Editor
Jul 11, 2011 at 11:04 PM
Yea I am using Advanced Menu now. No luck. I added the localization part to Menu, Menu Item, Simple Item.

Sent from my iPhone so message may be brief.

On Jul 11, 2011, at 5:42 PM, "bertrandleroy" <notifications@codeplex.com> wrote:

From: bertrandleroy

Did you lok at the advanced menu from the gallery?

Coordinator
Jul 11, 2011 at 11:08 PM

Yes, I'm not sure Piotr ever got to building that part, although he said he would at some point.

Editor
Jul 11, 2011 at 11:13 PM

 

Does the standard Menu support localization? I know the culture picker has some functionality where it parses out the nodes that are not in the current culture. Or thats what it said at least in the docs.

Coordinator
Jul 11, 2011 at 11:17 PM
It does not.

Sent from my TI-99/4A

From: arock3
Sent: Monday, July 11, 2011 3:13 PM
To: Bertrand Le Roy
Subject: Re: Localizing Menu Items with Hierarchial Navigation Enabled [orchard:264725]

From: arock3

Does the standard Menu support localization? I know the culture picker has some functionality where it parses out the nodes that are not in the current culture. Or thats what it said at least in the docs.

Editor
Jul 11, 2011 at 11:49 PM
So what's your recommendation for localizing Nav Items? I was going to write some code in Advanced Menu to just toss out nav items from the list that don't match the culture cookie.

Sent from my iPhone so message may be brief.

On Jul 11, 2011, at 6:18 PM, "BertrandLeRoy" <notifications@codeplex.com> wrote:

From: BertrandLeRoy

It does not.

Sent from my TI-99/4A

From: arock3
Sent: Monday, July 11, 2011 3:13 PM
To: Bertrand Le Roy
Subject: Re: Localizing Menu Items with Hierarchial Navigation Enabled [orchard:264725]

From: arock3

Does the standard Menu support localization? I know the culture picker has some functionality where it parses out the nodes that are not in the current culture. Or thats what it said at least in the docs.

Coordinator
Jul 11, 2011 at 11:55 PM

I'm afraid I don't have a very good answer. Our loc story is not complete and this is one of the holes in it. So to be clear, adding the localization part to the menu item type actually does work, but the admin UI does not know how to handle it. You would probably have to put together a small controller and associated admin screen to handle the translations to the items.

Editor
Jul 14, 2011 at 4:38 PM

I got around this problem for now by creating three menus. One for Spanish, French, and English. Then I used the Culture Layer module to define layers for the specific cultures and show the appropriate navigation menus. Not ideal but it works for now.

Jul 14, 2011 at 4:44 PM

Did you find a solution to this? Am in the same boat

Jul 14, 2011 at 4:44 PM

Ok, think you replied just as I was asking , will take a look :)

Jul 25, 2011 at 12:44 PM
Edited Jul 25, 2011 at 1:13 PM

Thanks arock3, Culture Layer module works perfect for me!

Editor
Jul 25, 2011 at 12:55 PM

What I had to do here was create two new menus for French and Spanish. Then I installed the "Culture Layer" module. I used the culture layer rules to create a Spanish and French Layer. Lastly, I added the menu widget for the corresponding layers containing the localized menus.

Definitely not the ideal solution...but I did not have success (or time) to modify any code. I noticed there was no menu filtering as suggested by the Culture Picker module.

Developer
Aug 1, 2011 at 4:28 PM
Edited Aug 1, 2011 at 4:34 PM

This is the way it should be done for now - separate menus for separate cultures. I guess it's not a worse solution than translating each item as it gives you much more control (the menus can differ in structure) with almost the same amount of work.

You could also add the all the menu title strings that need to be translated into appropriate orchard-module.po files, that should be placed under ~/Modules/Szmyd.Orchard.Modules.Menu/App_Data/Localization/[culture]/. Each menu item makes use of the built-in translation mechanism, so those strings will get translated (but you have to keep track of changes and manually update *.po files accordingly) when you change your global culture.

Bertrand's right - the built-in localization in Orchard has a lot of things tbd yet to be fully functional and easy-to-use...

Oct 15, 2011 at 12:53 AM

Hello Piotr,

We tried your second suggested approach by placing a French (France) po file here:

~Modules/Szmyd.Orchard.Modules.Menu/App_Data/Localization/fr-FR/orchard.module.po

Contents:

# Advanced Menu resource strings - fr-FR

 

#| msgid "Home"

msgid "Home"

msgstr "Accueil"

 

#| msgid "Account"

msgid "Account"

msgstr "Compte"

 

We then Added two menu items with the names given above, restarted the site, but we're not seeing localized menu items. Is there something we're missing?

Thanks.

Editor
Oct 15, 2011 at 2:01 PM

Did you add the localization part to the Advanced Menu Item content type?

Oct 17, 2011 at 7:30 PM

I don't see an advanced menu item content type. There's menu, menu item, menu widget, simple menu item, styled menu widget and Templated menu item. I tried adding the localization part to all of them and none of them worked. The only difference I noticed at all was that adding the localization part to the styled menu widget caused the menu to stop working altogether.