SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TRichEdit and charset

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
Munzig



Joined: 26 Aug 2004
Posts: 4

PostPosted: Thu Aug 26, 2004 2:56 pm    Post subject: TRichEdit and charset Reply with quote

I have to localize my applications into Russian and I noticed some problems with CHARSETS.

The Translation Editor doesn't support CharSet's for TComboBox and TRichEdit. It should be included in future.

When I change to Russian, I have to set by myselfe
ComboBox.Font.Charset:= RUSSIAN_CHARSET;
Of course I have to change back, when I choose another languages in the ComboBox.

But Charset is ignored for TRichEdit. Even when I specify Russian, I get strange characters. Can anybody help?

Do I get problems on a Russian OS if I leave all the charsetís on DEFAULT_CHARSET? Which charset is actually the default one and where can I check it on the OS? It seems that it is not displayed under Control Panel's Regional Settings.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Fri Aug 27, 2004 3:39 am    Post subject: Reply with quote

In case any control has ParentFont property set to True it won't be included into Charsets and Fonts list, since it will change these on parent font changing. The same applies to RichEdit.
But please note: Delphi's Combobox as well as some other controls like TCheckBox, TRadioButton, TButton are just wrappers of respective Windows controls and they will support RUSSIAN_CHARSET only when OS supports such charset. http://www.sicomponents.com/forum/viewtopic.php?t=12 may give you some details and ideas.
Charset is taken in account for RichEdit only in case its PlainText property is set to True.
When using DEFAULT_CHARSET it will be used the charset depending on user's OS locale information. So in case users have Russian OS installed they will be able to see Russian characters.
Back to top
View user's profile Send private message
Munzig



Joined: 26 Aug 2004
Posts: 4

PostPosted: Fri Aug 27, 2004 2:41 pm    Post subject: Charset Reply with quote

Igor, thank you for your answer. The property ParentFont are false for my TRichEdit instances. When I set now PlainText to false the charset-list doesnít appear in the Translation Editor. Only new instances will be shown in this list. How can I refresh it?

English Windows XP with default settings supports Russian text of a TComboBox when I set the Charset property. But its instance doesnít show up in the charset list although ParentFont is false. Is there a way to get it in the list? Since I can see it in the object inspector, SiComponents should mange it in future, even if it is a wrapped Windows control. For the moment I have to do it with code.

I change e.g. TMemo from Russian (charset is RUSSIAN_CHARSET) into German (charset is empty). I expected that DEFAULT_CHARSET will be used as specified in the first English column. But German umlauts appear now as Russian letters. Means this that I have to specify always a charset and cannot use DEFAULT_CHARSET or leave it unspecified? Is it a bug? It seams that Tsilang doesnít set it back to the default one.

The empty fields of Translation Editorís charset and font list is not really consistent. Only the fist language is filled. But all columns should be initialised.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Fri Aug 27, 2004 4:35 pm    Post subject: Reply with quote

Dirk,

1. It looks like you don't use latest version available on our site, right? It contains some things related to Charsets fixed as well as other improvements.
2. When any "item" is empty in translations list TsiLang will act as following depending on TranslateType property settings:
- ttNoChange (default) - the current value won't be changed.
- ttGetDefault - there will be used the default (from first language) value.
So in your case when you have empty values for some Charsets TsiLang just doesn't change the property since I'm sure TranslateType is set to ttNoChange.
3. Actually, it is always better to specify correct Font and Charset for all languages and controls. The Propagate popup-menu item allows you easy and fast (in 2 mouse clicks) fill all controls with values from first item (usually Form component).
4. The appearance ot not of controls in Charsets list is controlling only Exclamation their ParentFont property, not PlainText or others. The fix for correct handling of this was implemented in later versions.
5. In Translation Editor there is even menu item "Tools|Settings|Auto-use Default Fonts" (again this was introduced in later versions) which allows to automatically insert values for Charset and Font depending on language name and settings from Default Fonts dialog when Translation Editor starts.

Quite long message Smile Hope it will help you.
Back to top
View user's profile Send private message
Munzig



Joined: 26 Aug 2004
Posts: 4

PostPosted: Mon Aug 30, 2004 11:32 am    Post subject: Charset Reply with quote

Hi Igor,

1. Iím using version 3.5.1.1 under Delphi 4 and 7. There is missing the charset list for created TRichEdit and TComboBox objects. How can I force the creation of this list?

2./3. I use always ttGetDefault. But Iíll use never again DEFAULT_CHARSET for any language. Starting an application on an e.g. German OS, switching to Russian (ComboBox) and than back to German will replace German umlauts (ä, ö, ü, Ö) with Russian letters. The default charset seams not to stay static but replaced by Russian_Charset. DEFAULT_CHARSET is very dangerous if you change the language in runtime. For this reason it should be not present in the ComboBox of the Translation Editor.

4. As I explained: Iím missing the charset list for my created TRichEdit and TComboBox objects.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Mon Aug 30, 2004 12:13 pm    Post subject: Reply with quote

To clear/update incorrectly created Charsets list:
1. Open Translation Editor
2. Go to Charsets and click Clear on tool bar
3. Go to fonts and click Clear on tool bar
4. Close Translation Editor.
5. Open Translation Editor (now it shall list all lists correctly).
Back to top
View user's profile Send private message
Munzig



Joined: 26 Aug 2004
Posts: 4

PostPosted: Tue Aug 31, 2004 9:02 am    Post subject: TRichEdit and charset Reply with quote

Thanks Igor. I was not aware of the clear function. TComboBox and TRichEdit are now present in the charsets and fonts lists. The charset of TComboBox is now correctly updated when I change the language.

There is still the problem with TRichEdit. Even when I specify the correct charset, the content of multilines is not displayed with Russian charset. ParentFont is false and PlainText is true.

All other used text objects (Tlabel, TComboBox, TMemo) are correctly displayed.
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Tue Aug 31, 2004 1:35 pm    Post subject: Reply with quote

Unfortunately, TRichEdit is just wrapper of Windows control and will be able to display only characters supported by system Default Locale. So incase your system locale will be Russian you will be able to see Russian and English characters, but not German. In case of German locale you won't be able to see Russian.
The max what could be done is to use then RTF formatting. I've created a small sample which demonstrates this:
http://www.sicomponents.com/soft/demos/RichEditGermanRussian.zip
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group