Implementing a multilingual website using ASP.Net

I am using a multilingual website using ASP.Net. Languages ​​are English, French and Arabic. Please note that the Arabic direction is RTL. What is the best way to implement multilingual support. I plan to use the .Net localization function, but the texts of websites are stored in the database. For controls (form controls) I can use the resx file. Do I need to create two different pages (one for LTR and one for RTL)? Or can I get one ASPx file for all three languages?

I would like to hear some recommendations on the implementation of such web applications.

Thanks in advance,
Abdel Olakar

+6
html c # localization
source share
1 answer

The first problem is multilingualism: Just create a basepage class that will be inherited from the page class, put this method in the basepage class, and inherit the basepage class on your aspx.cs page to achieve 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(); } 

The second problem is RTL and LTR: there is a main div in your main page, like ..

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

you need to change direction and put it in the 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 have any problems ...

+3
source share

All Articles