Localizing custom content of custom content type and main menu text

Topics: Localization
May 29, 2012 at 2:18 AM
Edited May 29, 2012 at 2:41 AM

Good morning everyone,


How are you guys doing today?  I am a new Orchard developer/user that's still trying to feel around the environment and try to get better at it.  I have a quick question, how would I be able to localize custom content and localizing the text verbiage for the menu?

What I mean by custom content is when you click on the "Content" nav link on the left hand side bar, you go to the "Manage Content" screen.  You click the "Content Types" tab and click on the "Create new type" button to create a new content type.  Then use that new content type to create a new "Content Item".  How would I localize that?

And for the default main menu, how does one localize its text verbiage?  I plan to use Piotr Szmyd's "Advanced Menu" module so on that note, how does one localize the text verbiage for that?

Are there any plan's to incorporate Piotr Szmyd's "Advanced Menu" module into Orchard as one of the Core Orchard modules because having submenu items and sub sub menu items nowadays is pretty much standard and a must have on many websites?

Thank you very much for reading my questions.  I really appreciate it.  And i'm very sorry for so much questions, I'm still a newbie with Orchard and really go all in, in trying to learn and figure out Orchard.


Thank you very much for your help.


Take care and have a great day


Sam

May 29, 2012 at 7:08 AM
Edited May 29, 2012 at 7:13 AM

How we're doing things:

  • We're currently working on a custom menu system that has support for multi-language (well, more like multi-culture).
    • Note: We used the 'Advanced Menu' module as our 'KB' to figure out how to do some things.
  • We use the Orchard.Localization module for basic localization of content
  • We use custom tokens that use the Orchard.Localization stuff to generate our urls (like /en/bla/1 and /nl/bla/1)
  • We use a custom 'catch all' route ("{*path}") that catches requests for none existing page requests and tries to redirect the request (internally) to the valid page. Also, we override the default Contrib.RewriteRules functionality so that we can use our localization system AND still use rewrite.

The 'catch all' route thing is an important part of our system, as we use it to internally redirect to localized or default (fall back) content.

Some examples:

Dutch (nl-NL) visitor visiting the homepage '/'

  1. We try to resolve / but that will fail since none of our content is marked as the 'home'
  2. Based on the culture of the visitor, we redirect him internally to /nl
  3. If /nl doesn't exist, our catch all will kick in again, and then try to redirect him to the default culture (/en)
  4. Finally, if /en wasn't found either, a 404 message is shown

Same goes for every page on our site. This makes it possible to give people links with or without the culture prefix, as the browser's culture will be used instead then.

Pretty powerful I'd say, but I don't think we can release much to the public (yet?) but if you need some code as an example, just ask something specific and I'll see what I can do. Most of our work is meant just for our client, but I got an OK to release some bits to the public if needed.

I hope this gives you some idea what kind of work can / needs to be done for localization for a big site (read: plenty of localized content (5 languages, 16 planned), interactive features, ...)

If you have any other questions, just ask on this topic or meet me (Gecko) on irc @ irc.freenode.org / #Orchard (I'm in there again since today)

Coordinator
May 29, 2012 at 6:14 PM

@AimOrchard ... hum ... we are also working on a new Core Orchard menu, maybe you should come to weekly meetings to see what we've been doing so far ;)

Jun 3, 2012 at 5:14 AM
Edited Jun 3, 2012 at 5:14 AM

hi sebastienros,

that is great to hear!!!  will this new core orchard menu allow for submenus?  like the "Advanced Menu" created by Piotr Szmyd??? and will localization of the menu be easier?

 

thank you very much

Coordinator
Jun 3, 2012 at 5:59 AM

It already does, yes. submenus and localization.

Jun 3, 2012 at 6:16 AM

good morning all,

how is everyone?  i have a big problem right now.  i can't seem to get the "Advanced Menu", "Localization", and "Culture Picker" modules to work together cohesively...

 

So i have a menu (installed the "Advanced Menu" module") which i add english version of "Page" content type pages to the menu.  So level 1 of the main menu all have english text linking to their english pages.  using the "Culture Picker" module, i select japanese so that my site switches to the japanese version where all content are japanese. 

the menu text, is not switching over to japanese and when i click on the menu items, it doesn't take me to their japanese "Page" content pages.  I am not taken to the japanese pages but instead the english pages.

not sure how i would go about fixing this.

pls advise

thank you and have a great day.

Jun 3, 2012 at 6:19 AM

hi sebastienros,

the new core orchard menu, is this in 1.4.2?  because i am using 1.4.1 .  I am not sure how to get the core menu in 1.4.1 to create submenus.

thank you

Coordinator
Jun 3, 2012 at 6:22 AM

No, it will be in 1.5

Jun 3, 2012 at 6:33 AM
Edited Jun 3, 2012 at 6:44 AM

hi sebastienros, bertrandleroy,

are there plans to create a core orchard module that is like the "Culture Picker" module by "Sergey Ermakovich", in 1.5?  that way, it would be nicely integrated seamlessly with the core "Localization" module and the new core menu module that will make localization for menu items, even better.  it would be great if it was part of the 1.5 core modules cuz allowing users to pick their desired culture will help to make localization usability even better.

are there also plans in 1.5 to make localizing custom content types and content types, available?

thank you so very much sebastienros for your quick response.

much much appreciate it.

Coordinator
Jun 4, 2012 at 5:45 PM

No, I don't see a problem with this being a module, or a reason why it needs to be in core.

For custom content types, what's wrong with adding the localizable part?