2

Some of my Arabic users are reporting problems back to me with my application giving errors.

Common for them seem to be they are using Hijri calendar and TDateTimePicker control causing problems (but quite possibly it is the entire TDateTime and RTL that has problems, I am not sure)

The Hijri Calendar has a different year start/end which is not well suited for my application. (AFAIK, Hijri first became available in Windows7.)

I have problem reproducing the error because 1) I can't read Arabic making it much harder 2) I can only pick Hijri when Windows is set to Arabic (otherwise it is not a visible option)

Anyone here with the same problems? I Use Delphi 2010

Can I force my application into using standard calendar? (as solution) or can I force Windows to Hijri calendar on English Windows? (for testing)

3
  • 1
    TDateTimePicker is only a Delphi wrapper around Windows common control. Commented May 20, 2011 at 14:11
  • Yes. But without being able to reproduce the bug in my system, I can not say exactly where the bug is. TDateTimePicker wrapper code, general DateTime RTL or maybe my own code. (Just my impression from bug reports that the TDateTimePicker component/API-wrapper is at least one of the causes to my problems.) But the problem only happens in Arabic/Hijri systems. Arabic/standard-calendar works fine
    – Tom
    Commented May 20, 2011 at 16:28
  • Could it be Y2K for the hijra calendar :-)
    – Sam
    Commented May 20, 2011 at 16:51

2 Answers 2

1

In XP anyways, if you already have not done so, on Control Panel's Regional and Languages options dialog, go to the Languages page and first check the Supplemental Language Support checkboxes (Install files for complex script and right-to-left languages (including Thai)". For fun, check the East Asian languages one too, for later when you're going to want to check that chinese characters work properly.

Then, from the Control Panel, "Regional and Language Options" go to the "Advanced" tab and change the "Language for non Unicode programs" to an Arabic language.

enter image description here

Next you can go to date/calendar options and change to calendar type:enter image description here

Hirji Calendar in arabic looks like this: التقويم الهجري

Original source MSDN: http://www.microsoft.com/middleeast/msdn/ArabicCalendar.aspx

Additional pro tip: If you aren't already doing so, start using VMs for internationalization testing. Do you really want to do all this to your main workstation? Not me. I do this stuff in VMs.

3
  • Thanks for the Hijri in Arabic! Will help me a tremendouslsy selecting the correct calendar! :) I will try it again in Win7 :) I have vmware, but well, I need to step through the code while the bug happens, so requires me to install newest dev environment etc. which I have not done at this point in my virtual mahchine :)
    – Tom
    Commented May 21, 2011 at 23:11
  • Hi I am testing right now. Seems I was able to in Win7 change change the date/format to Arabic and then select Hijri. As such it seems I can test with English language which helps a lot. (Thanks!) But I will keep the question open a little incase someone rexognizes the exact Delphi/Hijri problem (right now it seems I can no get my app to error on Win7 with Hijri calendar)
    – Tom
    Commented May 22, 2011 at 11:46
  • You have given precious little detail on the exact bug that you experience. You might want to put a bit more detail in.
    – Warren P
    Commented May 22, 2011 at 13:32
0

You can use the Windows API function SetLocaleInfo, this would change the user's settings in the windows control panel which may be undesirable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.