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
Just kidding
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
> 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
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...
> 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 + ')';
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