Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BiDirection languages

3 views
Skip to first unread message

Leaky

unread,
Jul 30, 2008, 6:42:15 AM7/30/08
to
Hi People,

Okay, I have come across an interesting issue in my multi lingual
application. On a form I set the caption in the following way...

Form.Caption := loContact.FullName + ' (' + loContact.MobileNo + ')';

Now this is fine in languages like french and german, but when this comes to
a biriection language such as Hewbrew, the layout gets all broken (this can
be manually replicated by adding "syslocale.middleeast := true;" before the
app init command).

So in english this will look like...

Fred Blogs (+447777111222)

But then in Hewbrew it will look like

(Fred Blogs (+447777111222

However, if I add some text after the final bracket it displays correctly.
I have read about direction markers but this only applies to Unicode. Is
there another way to get around this?

Thanks

Christian Klopfer

unread,
Jul 30, 2008, 11:42:56 AM7/30/08
to
Leaky schrieb:
Ask your local F1-Dealer *gg*

Just kidding

Try this:

Form.Caption := Format ('%s (%s)', [loContact.FullName,
loContact.MobileNo]);

Leaky

unread,
Jul 30, 2008, 1:00:46 PM7/30/08
to

> Try this:
>
> Form.Caption := Format ('%s (%s)', [loContact.FullName,
> loContact.MobileNo]);
>


Nope, that doesnt seem to work. I think it maybe the windows GDI that is
causing the issue.

Is there a way converting a unicode string into something compatible for a
caption property?

Cheers

Tristan


Yorai Aminov (TeamB)

unread,
Jul 30, 2008, 5:05:15 PM7/30/08
to
Leaky wrote:

> But then in Hewbrew it will look like
>
> (Fred Blogs (+447777111222

Not if the name is in Hebrew. Because this string contains only
English characters ("Fred Blogs") and neutral characters, Windows
can't assume it should be laid out from right to left.

> I have read about direction markers but this only
> applies to Unicode.

Direction marks are also supported in Hebrew and Arabic codepages.
#253 is the LTR mark, and #254 is the RTL mark.

--
Yorai Aminov (TeamB)
(TeamB cannot answer questions received via email.)
Shorter Path - http://www.shorterpath.com
Yorai's Page - http://www.yoraispage.com

Leaky

unread,
Jul 31, 2008, 9:17:48 AM7/31/08
to
Hi Yorai,

Thanks for the info. I couldnt understand why this was the case.

So do you know if it would be possible to insert direction markers into the
example or is that just not possible (taking into account that Im using
Delphi7)?

Thanks

"Yorai Aminov (TeamB)" <yam...@gmail.com> wrote in message
news:4890...@newsgroups.borland.com...

Yorai Aminov (TeamB)

unread,
Jul 31, 2008, 5:17:05 PM7/31/08
to
Leaky wrote:

> So do you know if it would be possible to insert direction markers
> into the example

Sure. Add an LTR mark if BiDiMode is bdLeftToRight. For other
BiDiMode values (which indicate a right-to-left reading order), add
an RTL mark:

if BidiMode = bdLeftToRight then
Text := UserName + #253 + ' (' + UserPhone + ')'
else
Text := UserName + #254 + ' (' + UserPhone + ')';

Christian Klopfer

unread,
Aug 1, 2008, 6:32:07 AM8/1/08
to
Leaky schrieb:

Since Borland products are not really Unicode-ready it is hard to find a
good solution. Maybe the TNT-Components can help you. Or maybe the
direct way using API.

I use unicode but only for european languages there is not "Backward
reading" *gg*

Sorry that I couldn't help you
Chris

0 new messages