How to use Arabic numbers in numbered lists?

5 posts, 2 answers
  1. ①Dr Mostafa
    ①Dr Mostafa avatar
    14 posts
    Member since:
    Oct 2015

    Posted 01 Sep Link to this post

    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:

     

  2. Answer
    Mihail
    Admin
    Mihail avatar
    223 posts

    Posted 06 Sep Link to this post

    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.
  3. ①Dr Mostafa
    ①Dr Mostafa avatar
    14 posts
    Member since:
    Oct 2015

    Posted 06 Sep Link to this post

    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.

  4. Answer
    Mihail
    Admin
    Mihail avatar
    223 posts

    Posted 08 Sep Link to this post

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
  5. ①Dr Mostafa
    ①Dr Mostafa avatar
    14 posts
    Member since:
    Oct 2015

    Posted 08 Sep Link to this post

    Thank you very much Mihail for your concern ...

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

Back to Top