none
Arabic Localization Problem RRS feed

  • Question

  • Hi,

    I am working on an issue reported to me that a control was not being proper localized for the Arabic (Algeria) date/time settings. I created a very simple win forms application to verify the issue. The code to display the pattern and date is as follows:

    private void Form1_Load(object sender, EventArgs e)
    {
         string pattern = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;
         string s = DateTime.Today.ToString( pattern );
         label1.Text = string.Format("pattern = '{0}'; date = '{1}'", pattern, s);
    }
     

    When I run the application, the numeric day is on the left, but since this is a right to left language, shouldn't it be on the right? I would attach an image, but when I try I receive an error saying I can't attach images until my account is verified.



    • Edited by DavidR_2012 Monday, December 10, 2012 7:10 PM
    Monday, December 10, 2012 7:10 PM

Answers

  • The thing with right-to-left languages is: They are right-to-left unless and except when they are left-to-right. It is complicated, varies between languages at least, and may vary between countries as well. However, it is usually the case that any embedded Latin strings/dates/numbers remain left-to-right internally, though being placed rght-to-left.

    Don't make any assumptions - check it out.


    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    We are here to learn, to share knowledge, and to earn points; all in about equal measure.


    Monday, December 10, 2012 7:17 PM
  • Hi David,

    As Pieter pointed out, this is complicated, particularly if you are not used to rtl.

    Try setting the RightToLeft property of your Label control to YES.  Here is an Algerian newspaper with the date showing - http://www.akhersaa-dz.com/.  This is the format I see if I use ar-DZ in my .NET application and set the RightToLeft property to YES.

    Also, Algerian date format is not necessarily the same as other Arabic date formats.

    I hope that helps.

    Regards,

    David

    Thursday, December 13, 2012 4:54 PM

All replies

  • The thing with right-to-left languages is: They are right-to-left unless and except when they are left-to-right. It is complicated, varies between languages at least, and may vary between countries as well. However, it is usually the case that any embedded Latin strings/dates/numbers remain left-to-right internally, though being placed rght-to-left.

    Don't make any assumptions - check it out.


    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    We are here to learn, to share knowledge, and to earn points; all in about equal measure.


    Monday, December 10, 2012 7:17 PM
  • Here's the strange thing. I have the date pattern set to "dd MMMM, yyyy", but when it displays the date, it is in the format "dd yyyy MMMM". 
    Monday, December 10, 2012 8:05 PM
  • As I said; Iit's complicated: Don't make any assumptions - check it out.


    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    We are here to learn, to share knowledge, and to earn points; all in about equal measure.

    Monday, December 10, 2012 8:09 PM
  • I tried to search online for the answer, but didn't find anything definitive. The closest I came was that some articles mentioned that numerics are always left to right? Is there any good resources you would recommend to check it out further?
    Monday, December 10, 2012 9:50 PM
  • I found this one:

    http://www.unicode.org/reports/tr9/


    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    We are here to learn, to share knowledge, and to earn points; all in about equal measure.

    Monday, December 10, 2012 10:04 PM
  • I just heard back from someone on my localization team and they confirmed that the date time format is incorrect. He sent me a screenshot of an Arabic website with the correct date format. All I would like is a confirmation as to whether or not the following format is right or wrong, and if it's wrong, is this a .NET bug?

    Here's the output from my simple .NET app after setting the date/time format to Arabic (Algeria): http://tinypic.com/view.php?pic=2z9boeq&s=6

    Tuesday, December 11, 2012 7:38 PM
  • Hi David,

    Welcome to the MSDN Forum.

    I am trying involve some other one into this case to confirm this issue, wait it patiently, please.

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, December 12, 2012 11:15 AM
    Moderator
  • Hi David,

    As Pieter pointed out, this is complicated, particularly if you are not used to rtl.

    Try setting the RightToLeft property of your Label control to YES.  Here is an Algerian newspaper with the date showing - http://www.akhersaa-dz.com/.  This is the format I see if I use ar-DZ in my .NET application and set the RightToLeft property to YES.

    Also, Algerian date format is not necessarily the same as other Arabic date formats.

    I hope that helps.

    Regards,

    David

    Thursday, December 13, 2012 4:54 PM