I am working on a web project that can be in multi langauges, i have done all of that, i still have one thing.
the pages when shows in english is from left to right.
some languages on my website needs to be from right to left
Note please, my question is about the whole page not the text in fields.
how can i do that please?
I am using this code for launching threads for many languages.
Thread.CurrentThread.CurrentCulture = new CultureInfo(CultureName);
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
I don't know what i think that the previous code could be helpful in order to achieve my goal.
bool Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft
See as example: http://afana.me/category/Website-Optimization.aspx?page=2
To flip the whole page use either HTML tag attributes
<body dir="rtl" align="right">
or CSS properties on body tag
direction:rtl; text-align:right;
Direction is to control BiDi for the language script. Align is used to control visual display alignment.
You can use this code in _Layout to Change text direction for all pages: in body tag
<body dir="@(System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft? "rtl" : "ltr")">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With