Users of my applications started to report "a bug", where GUI is displayed in RightToLeft mode while the interface was in English (or any other non-RTL language).
Initially, I did not consider this to be a bug, so I kept suggesting users to change their system locale to non-RTL language. However, the more I thought about it the more it seemed like a bug. Now, I am almost convinced that it is plain wrong to use system locale to determine BiDiMode of an application, especially when BiDiMode of system locale and application's language are different.
Few examples to demonstrate:
- System=Hebrew & Application=English => Application.BidiMode=bdRightToLeft (English in RTL)
- System=English & Application=Hebrew => Application.BidiMode=bdLeftToRight (Hebrew in LTR)
This is automatically applied by LCL in TApplication.Create, at initialization section of Forms.pp unit:
{$ifndef wince}// remove ifdef when gettext is fixed
LCLGetLanguageIDs(LangDefault, LangFallback);
if LangDefault <> '' then
FBidiMode := Direction(LangDefault)
else
FBidiMode := Direction(LangFallback);
{$else}
FBidiMode := bdLeftToRight;
{$endif}
I have also found a Bug Report #0022044:
Wrong Initial value for Application.BidiModehttp://bugs.freepascal.org/view.php?id=22044I would like to get opinions of users, application developers and Lazarus developers:
- Can we disable/remove/move setting of Application.BidiMode based on system language in LCL?
- Should Application.BidiMode be always initialized to bdLeftToRight by default?
- Should Application.BidiMode be a part of Project Settings?
- Should setting appropriate BidiMode be a responsibility of the developer of each application?
- Should i18n/l10n procedures be able to automatically set Application.BidiMode according the loaded language?