Using Orchard {culture} routes

Tags: Localization, Orchard

As part of the upcoming Orchard CMS 1.9 release, a new feature crept in as part of the localization work that has happened on the 1.x branch, and that is the ability to specify the culture in the route and Orchard will as if by magic use the localized version of that page if its available.

So.. What do I need to do?

There are two ways to use this new feature,

  1. Query parameter ?culture=en-GB

  2. Use Orchard routes.

    new Route("{culture}/foo"

Wonder how it all works? Take a look in to the file DefaultFrontEndCultureSelector.cs

Also note that Orchard will also try to determine the culture if it is a POST, so if you have a generic route with no culture, it will try to determine it from the referer or request path.

No Comments, be the first to leave one!

Leave a Comment

Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let's have a personal and meaningful conversation instead. Thanks for dropping by!