Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the flow direction from CurrentCulture in c#

HI Is there any way to get the FlowDirection for current culture.

I have set a property like

public string FlowDirection
{
get {
return // should return the flow direction using Thread.CurrentThread.CurrentUICulture.
}
}

I dont want to hardcode something like

if (currentLanguage.ToLower().StartsWith("ar"))
{
     return FlowDirection.RightToLeft;
}
else
{
    return FlowDirection.LeftToRight;
}
like image 620
Chinjoo Avatar asked Jan 25 '11 08:01

Chinjoo


1 Answers

use this: CultureInfo.TextInfo.IsRightToLeft

taken from related question

like image 170
Axarydax Avatar answered Nov 02 '22 22:11

Axarydax