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

How to use Arabic numbers in numbered lists?

4 Answers 406 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 01 Sep 2017, 05:07 PM

RadRichTextBox is realy a very powerful control, except when comes to using Arabic language. However, I made many posts regarding this issue and came up with e result; where such problems regarding Arabic language may be managed later on in next releases.

Any way, I found a work around; where I captured keyboard messages and replaced numbers with their Arabic representations using the following function:

Public Shared Function TranslateNumerals(ByVal _char As Char) As String
            If TranslationService.CurrentLocalizationInstance.CurrentLanguage = LanguageNames.Arabic Then
                Dim enc As New System.Text.UTF8Encoding
                Dim utf8Decoder As System.Text.Decoder
                utf8Decoder = enc.GetDecoder
                Dim sTranslated = New System.Text.StringBuilder
                Dim cTransChar(1) As Char
                Dim bytes() As Byte = {217, 160}
 
                ' Start Converting characters into Arabic mode.
 
                If Char.IsDigit(_char) Then
                    bytes(1) = 160 + CInt(Char.GetNumericValue(_char))
                    utf8Decoder.GetChars(bytes, 0, 2, cTransChar, 0)
                    sTranslated.Append(cTransChar(0))
                Else
                    sTranslated.Append(_char)
                End If
                TranslateNumerals = sTranslated.ToString
            Else
                TranslateNumerals = _char
            End If
        End Function

Where _char is an english number (e.g. 2,3,4,...) and the return string is the Arabic representation.

My question is: how to use such function to replace English numbers coming up from numbered lists, with their Arabic representation? I tried using ListLevelStyle but I could not find where lies the up coming numbers of the list.

Any help would be greatly appreciated .....

The attached image shows my requirement:

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Mihail
Telerik team
answered on 06 Sep 2017, 12:51 PM
Hello Mostafa,

I am afraid that this scenario is not considered when the lists were initially implemented. That is why I have logged a new feature request in our feedback portal. Here is a link if you would like to follow the item and receive notifications for status updates: Implement support for Eastern Arabic Numerals in list level bullet text.

Regards,
Mihail
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 06 Sep 2017, 01:43 PM

Thank you very much Mihail for your response.

But isn't any way to get the automatically generated list numbers, and then I could translate them into Arabic, then push them back into the list again.

0
Accepted
Mihail
Telerik team
answered on 08 Sep 2017, 07:08 AM
Hello Mostafa,

I am afraid that there is no workaround for this particular scenario as the logic responsible for the incremental generation of those numerals is entirely internal.

Please excuse us for the inconvenience.

Regards,
Mihail
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 you to write beautiful native mobile apps using a single shared C# codebase.
0
①Dr Mostafa
Top achievements
Rank 1
answered on 08 Sep 2017, 10:54 AM

Thank you very much Mihail for your concern ...

I hope support for Arabic Language could be available soon ....

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