Localization and RTL languages

Topics: Localization
Jun 12, 2011 at 5:24 PM
Edited Jun 12, 2011 at 5:25 PM

Hello and greetings to the wonderful Orchard developers and community,

I am new to Orchard and I am amazed by its potential.

I am working on localizing Orchard in Arabic and to be honest, I faced a big problem with the po files that I downloaded from Orchard' site because many strings are being repeated, meaning that I will have to enter the same text over and over and over (or that I am missing something! ;) )

Anyway, my question is not in the localization of Orchard's backend but in how Orchard handles multilingual sites which includes Right to left languages as well as Left to right ones!

When we have a multilingual website where all languages are RTL or LTR then it's easy to have one RTL or LTR theme that will be applied to all languages. But in the case where direction is mixed, there will be a need to change the theme according to the selected language. Is this possible to achieve with the current version of Orchard? And if not, what is the best way to achieve it?

Orchard is also using html.ActionLink in order to render html links. The problem with ActionLink is that it html encodes text and transform all non Latin characters to some unicode representation. So, As I am developing an Arabic website, Orchard will correctly saves the slug but the link to the content item will appear as : %D8%B9%D8%A7%D9%84%D9%85-orchard instead of عالم-orchard (meaning the world of Orchard).

Is there a way to bypass this encoding and render beautiful links without having to change Orchard's files?

Thank you very much for your support.

Jun 13, 2011 at 4:45 AM

To achieve RTL, you would have to build a theme that is designed for it.

As for ActionLink, please file a bug. In the meantime, you can probably pass in a new HtmlString instead of a regular string, to avoid the encoding.

Jun 13, 2011 at 4:55 AM

Hi Bertrand,

thank you for your reply.

I know that I have to build a theme designed for RTL but is there a way to use the RTL theme for RTL languages and the LTR theme for LTR languages (we can assign only one theme in the dashboard).

I am thinking that if a culture has an additional property indicating if it is RTL or LTR we could then make the same theme supporting RTL and LTR by selecting the correct css using a simple if. Is there a way to achieve that by writing a module or do I need to hack Orchard's code?

Jun 13, 2011 at 5:06 AM

You can actually have more than one theme active. You need to implement IThemeSelector to pick the one active for any given request.

Jun 13, 2011 at 5:21 AM

Wow, thanks!

I will dig around and see if I can achieve it.

Jun 16, 2011 at 7:01 AM
Edited Jun 16, 2011 at 7:02 AM

Hi Bertrand,

If you have any plans add RTL supporting out of box?

I think the localization and direction should be related to the culture.

I can not to use any themes from  the gallery for hebrew or arabic language.



Jun 16, 2011 at 7:00 PM

There is growing demand for it. I'm working with a few folks who need it, and we'll make it work one way or another.

Jun 16, 2011 at 9:39 PM

I agree with @igor609! A culture should have additional information like a user friendly display name (en-US => English) and direction.

I am currently working on an RTL theme and I will make sure to post it to the Orchard Gallery once it's done. Still I will have to figure out how to have an RTL administration theme given that currently changing the administration theme is not supported out of the box (to my limited knowledge).

Jun 16, 2011 at 9:45 PM

Culture objects in .NET *do* have a friendly name and direction.