6

I am implementing an multilingual web site using ASP.Net. The languages are English,French and Arabic. Please note that Arabic's direction is RTL. What is the best way to implement the multilingual support. I am planning to use the .Net localization feature but the website texts are stored in DB. For the controls ( form controls) , I can used resx file. Do I need to build two different pages ( one for LTR and another for RTL )? Or can I have one ASPx file for all the three languages?

I would like to hear some best practices in implementing these kind of web applications.

Thanks in advance,
Abdel Olakara

1 Answer 1

3

First Issue of Multilingual: Simply make a basepage class that will inherited from Page class, put this method in basepage class and inherit basepage class in your every aspx.cs page to acheive globalization.

protected override void InitializeCulture() 
{ 
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); //'en-US' these values are may be in your session and you  can use those
    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");//'en-US' these values are may be in your session and you  can use those
    base.InitializeCulture(); 
}

Second Issue of RTL and LTR: in your masterpage there is main div like..

<div runat="Server" id="divPageDirection">
</div>

you need to changed the direction and put this in your page load

divPageDirection.Attributes.Add("dir", "rtl");//rtl or ltr you will decide on which language is in your current session

please let me know if you any issue...

Sign up to request clarification or add additional context in comments.

2 Comments

I would probably go for loading a different style sheet for Arabic. There might be various other layout things you need to fine tune.
I agree with this answer.. but my issue is.. where to i store the arabic, french and english texts? I mean, what is the best method?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.