Arabic culture that uses the Gregorian calendar

Arabic culture that uses the Gregorian calendar

One of the multilingual sites I work on was recently converted to Arabic. The site was already running with French, German, Polish and a whole host of others but Arabic was our first right to left language on this particular site.

Once we got the right to left stuff working for our HTML - mostly by using the 'direction' attribute in CSS - we noticed that our code was failing when displaying dates in the system.

It turns out that our code was setup to use the Gregorian calendar but the base Arabic culture ('AR') uses a different style calendar, Hijri I believe.

The solution was to pass a specific Arabic culture to get it to work with our calendar. We chose Arabic Lebanese as this worked well and uses Gregorian calendars.

// setup .net to use Lebanese Arabic
Thread.CurrentThread.CurrentUICulture = new CultureInfo("ar-LB");
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ar-LB");

blog comments powered by Disqus

Get In Touch

Follow me online at TwitterFacebook or Flickr.

Latest Tweets