Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-10

Initial value of BidiMode in RightToLeft system

13 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Zaher Dirkey

Hi,
I have English tools, but it work as Right to left forms, becuase it get the BidiMode from the language, while i am not choose any language for my application.
That is not bug, it is wrong behavior.

application.inc line #111

  LCLGetLanguageIDs(LangDefault, LangFallback);
  if LangDefault  '' then
    FBidiMode := Direction(LangDefault)
  else
    FBidiMode := Direction(LangFallback);

This check must done manually by the developer when he choose new language (RTL) or load it.

FPC 2.4.4
Lazarus last 32791

Thanks
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111009/1d7e4e45/attachment.html>

Reply by email

Hans-Peter Diettrich
to Zaher Dirkey
Show quoted text 5 lines
Hi, I have English tools, but it work as Right to left forms, becuase it get the BidiMode from the language, while i am not choose any language for my application. That is not bug, it is wrong behavior.

Can you explain the correct (expected) behaviour?
(Give a link?)

I've never been working in an RTL environment, and have no idea how it should behave with Unicode (UTF-8). With Ansi controls it looks quite easy to me, there the choosen font (maybe language) imposes either LTR or RTL reading, with no further adjustments required.

DoDi

Reply by email

Zaher Dirkey
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 18 lines
Zaher Dirkey schrieb: Hi, > I have English tools, but it work as Right to left forms, becuase it get > the BidiMode from the language, while i am not choose any language for my > application. > That is not bug, it is wrong behavior. > Can you explain the correct (expected) behaviour? (Give a link?) I've never been working in an RTL environment, and have no idea how it should behave with Unicode (UTF-8). With Ansi controls it looks quite easy to me, there the choosen font (maybe language) imposes either LTR or RTL reading, with no further adjustments required.

When i start new application it is normal to be English And left to right, not Right to left

If i want it Arabic (RTL) i must set it by my self, after my language loaded, or if my form already done in Arabic language.

GetLanguageIDs get the RTL of the my envirement system (Windows) not from my application.
My system set to be RTL, now my English application set to be RTL, and that wrong.

In short to understand what happened
----------
Imagine that you made an English tools worked fine for you (not multi language tools), and you send it to me, that tools will flip to use RTL in my system with English language.
----------

Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111010/2c19fb97/attachment.html>

Reply by email

ik
to Zaher Dirkey

Hi Zaher,

2011/10/10 Zaher Dirkey

Show quoted text 39 lines
On Mon, Oct 10, 2011 at 7:46 AM, Hans-Peter Diettrich < > wrote: > Zaher Dirkey schrieb: > > Hi, >> I have English tools, but it work as Right to left forms, becuase it get >> the BidiMode from the language, while i am not choose any language for my >> application. >> That is not bug, it is wrong behavior. >> > > Can you explain the correct (expected) behaviour? > (Give a link?) > > I've never been working in an RTL environment, and have no idea how it > should behave with Unicode (UTF-8). With Ansi controls it looks quite easy > to me, there the choosen font (maybe language) imposes either LTR or RTL > reading, with no further adjustments required. > > When i start new application it is normal to be English And left to right, not Right to left If i want it Arabic (RTL) i must set it by my self, after my language loaded, or if my form already done in Arabic language. GetLanguageIDs get the RTL of the my envirement system (Windows) not from my application. My system set to be RTL, now my English application set to be RTL, and that wrong. In short to understand what happened ---------- Imagine that you made an English tools worked fine for you (not multi language tools), and you send it to me, that tools will flip to use RTL in my system with English language. ----------

I agree with you, but most Delphi developers decided that the want more Delphi approach rather then anything else, so that why you have that code afaik.
It's time to think what we prefer, Delphi computability or decide if we want to set new ground rules.

Show quoted text 10 lines
Zaher Dirkey -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111010/1cab9dde/attachment.html>

Reply by email

Hans-Peter Diettrich
to Zaher Dirkey: On Mon, Oct 10, 2011 at 7:46 AM, Hans-Peter Diettrich When i start new application it is…
Show quoted text 23 lines
On Mon, Oct 10, 2011 at 7:46 AM, Hans-Peter Diettrich < <mailto:>> wrote: Zaher Dirkey schrieb: Hi, I have English tools, but it work as Right to left forms, becuase it get the BidiMode from the language, while i am not choose any language for my application. That is not bug, it is wrong behavior. Can you explain the correct (expected) behaviour? (Give a link?) I've never been working in an RTL environment, and have no idea how it should behave with Unicode (UTF-8). With Ansi controls it looks quite easy to me, there the choosen font (maybe language) imposes either LTR or RTL reading, with no further adjustments required. When i start new application it is normal to be English And left to right, not Right to left

What exactly is or should be right-to-left? Menus? Form layout?

Text orientation in labels and edit boxes IMO should depend on the character set, not on language settings.

If i want it Arabic (RTL) i must set it by my self, after my language loaded, or if my form already done in Arabic language.

I understand that an Arabic application should have e.g. an label to the right of an edit box, where LTR would have the label to the left. Doesn't this mean that all origins and directions of the controls should be swapped, i.e. (0,0) should be the top-right point in the form?

GetLanguageIDs get the RTL of the my envirement system (Windows) not from my application. My system set to be RTL, now my English application set to be RTL, and that wrong.

Well, then every application should have a design (or layout) language, that e.g. swaps the left and right borders.

Show quoted text 6 lines
In short to understand what happened ---------- Imagine that you made an English tools worked fine for you (not multi language tools), and you send it to me, that tools will flip to use RTL in my system with English language. ----------

Is e.g. the Lazarus IDE flipped automatically? When you switch the IDE language?
[I get a really weird layout, when I switch the IDE to e.g. Hebrew, with very different window sizes]

Can you supply an screen shot, to make more clear *what* exactly is flipped on your system?

DoDi

Reply by email

waldo kitty
to ik: 2011/10/10 Zaher Dirkey I agree with you, but most Delphi developers decided that the…
ik wrote 13 lines
Hi Zaher, 2011/10/10 Zaher Dirkey < <mailto:>> In short to understand what happened ---------- Imagine that you made an English tools worked fine for you (not multi language tools), and you send it to me, that tools will flip to use RTL in my system with English language. ---------- I agree with you, but most Delphi developers decided that the want more Delphi approach rather then anything else, so that why you have that code afaik. It's time to think what we prefer, Delphi computability or decide if we want to set new ground rules.

ido, are you saying that delphi compiled english language apps that are executed on RTL systems will flip the english backwards and display it RTL instead of LTR???

Reply by email

ik
to waldo kitty
waldo kitty wrote 26 lines
On 10/10/2011 02:31, ik wrote: > Hi Zaher, > 2011/10/10 Zaher Dirkey < <mailto:>> > > In short to understand what happened > ---------- > Imagine that you made an English tools worked fine for you (not multi > language tools), and you send it to me, that tools will flip to use RTL > in > my system with English language. > ---------- > > I agree with you, but most Delphi developers decided that the want more > Delphi > approach rather then anything else, so that why you have that code afaik. > It's time to think what we prefer, Delphi computability or decide if we > want to > set new ground rules. > ido, are you saying that delphi compiled english language apps that are executed on RTL systems will flip the english backwards and display it RTL instead of LTR???

As far as I understand, yes. I never tried it myself, or seen their code for that.
There was a discussion at the forums or here at the malling list (I can not find it) early this year about this subject.

Ido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111010/b2b8d93d/attachment.html>

Reply by email

Zaher Dirkey
to ik: 2011/10/10 Zaher Dirkey I agree with you, but most Delphi developers decided that the…

Hi, Ido

2011/10/10 ik

set new ground rules

New rules best here, because even in Delphi it is wrong way to choose default BidiMode.

The Idea, for example it is easy to understand it, most programers used Lazarus without caring about BidiMode because they are use LeftToRight languages, so they are not add any extra code for it.

Now those programers will publish their tools in English, this tools run in our systems, will flip the forms RTL without translating it.

Best regard.
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111010/52165f50/attachment.html>

Reply by email

Zaher Dirkey
to Hans-Peter Diettrich: What exactly is or should be right-to-left? Menus? Form layout? Text orientation in…

On Mon, Oct 10, 2011 at 11:52 AM, Hans-Peter Diettrich <

wrote: Well, then every application should have a design (or layout) language, that e.g. swaps the left and right borders.

No, the problem is more easy than choose layout for a language, because the flip controls work fine for us.
The problem is around the default BidiMode (initial value) in Application.BidiMode.

Best Regards
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111010/119ca45b/attachment-0001.html>

Reply by email

waldo kitty
to Zaher Dirkey: Hi, Ido 2011/10/10 ik New rules best here, because even in Delphi it is wrong way to…
Zaher Dirkey wrote 16 lines
Hi, Ido 2011/10/10 ik < <mailto:>> set new ground rules New rules best here, because even in Delphi it is wrong way to choose default BidiMode. The Idea, for example it is easy to understand it, most programers used Lazarus without caring about BidiMode because they are use LeftToRight languages, so they are not add any extra code for it. Now those programers will publish their tools in English, this tools run in our systems, will flip the forms RTL without translating it.

i just want to ensure that *i'm* understanding this... what you are saying is that

This sentence looks like this on LTR.

would look like the following on your RTL system

.RTL no siht ekil skool ecnetnes sihT

correct?

Reply by email

Zaher Dirkey
to waldo kitty: ido, are you saying that delphi compiled english language apps that are executed on RTL…
waldo kitty wrote
ido, are you saying that delphi compiled english language apps that are executed on RTL systems will flip the english backwards and display it RTL instead of LTR???

In Delphi and Windows it is happened only when the Windows use Right To Left Desktop, so most of programmers not noticed it.

Thanks
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111010/0c93cddc/attachment.html>

Reply by email

Zaher Dirkey
to ik: As far as I understand, yes. I never tried it myself, or seen their code for that. There…

2011/10/10 ik

Show quoted text 36 lines
On Mon, Oct 10, 2011 at 17:16, waldo kitty wrote: > On 10/10/2011 02:31, ik wrote: > >> Hi Zaher, >> 2011/10/10 Zaher Dirkey < <mailto:>> >> >> In short to understand what happened >> ---------- >> Imagine that you made an English tools worked fine for you (not multi >> language tools), and you send it to me, that tools will flip to use >> RTL in >> my system with English language. >> ---------- >> >> I agree with you, but most Delphi developers decided that the want more >> Delphi >> approach rather then anything else, so that why you have that code afaik. >> It's time to think what we prefer, Delphi computability or decide if we >> want to >> set new ground rules. >> > > ido, are you saying that delphi compiled english language apps that are > executed on RTL systems will flip the english backwards and display it RTL > instead of LTR??? > > As far as I understand, yes. I never tried it myself, or seen their code for that. There was a discussion at the forums or here at the malling list (I can not find it) early this year about this subject. Ido

Hi Ido, I think this piece of code belong to you, i want to understand the original problem, maybe we can resolve it in another way.

LCLGetLanguageIDs(LangDefault, LangFallback);
  if LangDefault  '' then
    FBidiMode := Direction(LangDefault)
  else
    FBidiMode := Direction(LangFallback);

Best Regards
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111011/66767b1e/attachment.html>

Reply by email

ik
to Zaher Dirkey

2011/10/11 Zaher Dirkey

Show quoted text 42 lines
2011/10/10 ik > On Mon, Oct 10, 2011 at 17:16, waldo kitty wrote: > >> On 10/10/2011 02:31, ik wrote: >> >>> Hi Zaher, >>> 2011/10/10 Zaher Dirkey < <mailto:>> >>> >>> In short to understand what happened >>> ---------- >>> Imagine that you made an English tools worked fine for you (not multi >>> language tools), and you send it to me, that tools will flip to use >>> RTL in >>> my system with English language. >>> ---------- >>> >>> I agree with you, but most Delphi developers decided that the want more >>> Delphi >>> approach rather then anything else, so that why you have that code >>> afaik. >>> It's time to think what we prefer, Delphi computability or decide if we >>> want to >>> set new ground rules. >>> >> >> ido, are you saying that delphi compiled english language apps that are >> executed on RTL systems will flip the english backwards and display it RTL >> instead of LTR??? >> >> > As far as I understand, yes. I never tried it myself, or seen their code > for that. > There was a discussion at the forums or here at the malling list (I can > not find it) early this year about this subject. > > Ido > > Hi Ido, I think this piece of code belong to you, i want to understand the original problem, maybe we can resolve it in another way.

Yes, it was mine (I can't find the original discussion about it though)

Show quoted text 8 lines
LCLGetLanguageIDs(LangDefault, LangFallback); if LangDefault '' then FBidiMode := Direction(LangDefault) else FBidiMode := Direction(LangFallback);

It was made to make a Delphi compatible behavior, after Avishai at the Lazarus forum, complained that it does not work the same at all, and explained what should be done.
Also the default GTK behavior works the same, so if your locale is a right to left language, even if you did not translated anything, it will mirror everything.
Personally I think that the developer should choose, and not the system, but it was to solve the comparability issues.

Best Regards Zaher Dirkey

Ido

Show quoted text 8 lines
-- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20111011/815769f0/attachment.html>

Reply by email