tags:

views:

175

answers:

4

I have a website, its content is in English. I want to access my website in two languages (or more) English and Arabic.

In this case, how do I build my website with these two languages?

Can anyone give an example for this or any reference?

A: 

You can use a resource file with all the strings used by one site, and create one for English and one for Arabic.

Since your question is not very specific, you can look deeper and then ask again if you still have doubts to MSDN

jpabluz
+1  A: 

Depends on what you want to translate between English and Arabic.

Arabic is a semitic language which you write from right to left, while English is written from left to write. This most of the times means that the layout of your application needs to be mirrored (menu & navigation, at least). I'd keep this mirroring as much as possible in the master page. Or even better, in CSS. You could then have an 'if...else' which references respectively a left-to-right CSS or a right-to-left CSS.

Further, the text can be easily placed in a resource file. dotNET supports loading the right resource file depending on your CurrentCultureUI settings. Where you'd have dynamically created strings, I'd use string.Format(...) method to replace the dynamic words.

This is for the basics, you'd still have to decide what to do with more advanced 'custom' parts of the application.

taoufik
+1 for mentioning text direction issues. It's not as simple as it looks like. :)
Arnis L.
A: 

for a down-and-dirty solution, just install the wibiya widget and your users will be able to translate your page quite easily into any language you want - see http://www.wibiya.com for more

I can't vouch for the quality of the translations but it's a decent fallback option if you can't write the il8n code yourself...

hope it helps

stephenmurdoch
A: 

CodeProject

Use this. Not so much text as on MSDN - good for beginning. Not so hard, but alot of routine.

Stremlenye