This is a migrated thread and some comments may be shown as answers.

Date time formate problem in arabic culture

3 Answers 563 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
①Dr Mostafa
Top achievements
Rank 1
①Dr Mostafa asked on 24 Dec 2017, 05:56 PM

My application runs under Arabic culture. After setting IsTrackChangesEnabled to true, and user starts making changes, then saves the document. When he opens the document next time the error shown in the image below develops.

I assume that; this occurred because, changes are tracked by date and time, and when displayed later on they must be displayed using their localization culture which is English.

Is there a way to set culture of RadRichTextBox or the component responsible for tracking changes, or any other solution?

Any help will be greatly appreciated....

3 Answers, 1 is accepted

Sort by
0
Accepted
Peshito
Telerik team
answered on 26 Dec 2017, 02:59 PM
Hello,

I tried to reproduce this issue but to no avail. Could you send us the document reproducing the issue?

Changing the culture of RadRichTextBox can be achieved as shown below:
var culture = new CultureInfo("ar-SA") { NumberFormat = { DigitSubstitution = DigitShapes.NativeNational } };
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
Add the code above to your App.xaml.cs. To present the dates into the desired format you need to set the NumberFormat of the CultureInfo to the NativeNational DigitShape.

Hope this helps.

Regards,
Peshito
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
①Dr Mostafa
Top achievements
Rank 1
answered on 26 Dec 2017, 07:51 PM
Thank you very much for your response. I will try out your solution, and I will inform you soon about the result.
0
①Dr Mostafa
Top achievements
Rank 1
answered on 26 Dec 2017, 08:51 PM

Thank you very very much Peshito. It worked. It seamed that I missed setting DigitSubstitution of NumberFormat of the Arabic culture, as you suggested.

I marked your response as answered.

Tags
RichTextBox
Asked by
①Dr Mostafa
Top achievements
Rank 1
Answers by
Peshito
Telerik team
①Dr Mostafa
Top achievements
Rank 1
Share this question
or