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 

Problem with D2009, TsiLang V6.4 and StoreAsUTF8

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



Joined: 16 May 2008
Posts: 10

PostPosted: Fri Mar 27, 2009 6:04 pm    Post subject: Problem with D2009, TsiLang V6.4 and StoreAsUTF8 Reply with quote

Hello,

i have updated to V 6.4 because the StoreAsUTF8 Problem is solved now...But, is it really solved?

After setting StoreAsUTF8 to true, for some of our 200 Forms, i found that many strings are corrupted. Russian strings are displayed like this 3D ???? ???. / ????. , German chars, like or are replaced with little boxes.

It was possible, thanks for this, to set StoreAsUTF8 back to false. Everything works now, like it works before.

But i have the same problems like i had before

ASiLang.SaveAllToFile(LanguageFile, siFileDelimiter);


produces question marks for cyrillic letters. So the users are not able to translate the app on their own.

What can i do? Is this a StoreAsUTF8 problem, or is it anything else?

best regards
Torsten
Back to top
View user's profile Send private message
tportoff



Joined: 16 May 2008
Posts: 10

PostPosted: Fri Mar 27, 2009 6:21 pm    Post subject: Found the problem, but not the solution Reply with quote

Hello,

ok, i made some more tests. Saving SIl files works, if the TsiLangLinked has a TForm as owner and the Charset's are correct...but it failes if the TsiLangLinked is used on a DataModule, because a DataModule has no CharSet properties.
That is really a problem for us, because we use many data modules.

Everything works with the IDE editor. Why not in sil files?

best regards
Torsten
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Mon Mar 30, 2009 8:46 am    Post subject: Reply with quote

Hello,

SIL files are ANSI but Delphi 2009 DFMs and as result translation data are Unicode. So in order to be able to convert from Unicode to ANSI while saving to SIL file TsiLang needs charset data. We will try to improve this but you also may consider using SIB files for translation storage as this problem doesn't actual for them.
Back to top
View user's profile Send private message
tportoff



Joined: 16 May 2008
Posts: 10

PostPosted: Mon Mar 30, 2009 1:55 pm    Post subject: SIL and SIB.... Reply with quote

Hello Igor,

i have tried the SIB files. The result is exactly the same. Translations from Forms are correct, translations from DataModules are corrupted. I think the missing charset informations in DataModules are the problem.

Is there any way to use DataModules and external translation files?

best reagrds
Torsten
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Tue Mar 31, 2009 5:27 am    Post subject: Reply with quote

Hello Torsten,

Did you create the datamodules under Delphi 2009 from scratch or you've converted them from earlier versions of Delphi? Only in the later case there could be a such problem. In order to workaround this (migrating datamodules from earlier version to Delphi 2009) you can use the following:
1. Open the datamodule in earlier version and set StoreAsUTF8=True.
2. Save the unit.
3. Open it in Delphi 2009.
After these steps the data should be correct.
Please let me know if this helps.
Back to top
View user's profile Send private message
tportoff



Joined: 16 May 2008
Posts: 10

PostPosted: Tue Mar 31, 2009 11:29 am    Post subject: Reply with quote

Hello Igor,

yes, we are coming from D2005. I followed your advice but the result are ??????? question marks. Now in the IDE editor, too. Thanks to our VCS, this not a problem.

I have used V6.4 in D2005 and D2009.

best regards
Torsten
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Wed Apr 01, 2009 9:26 am    Post subject: Reply with quote

Please send us sample datamodule(s) that reproduce this and we will try to find the origin of the problem.
Back to top
View user's profile Send private message
tportoff



Joined: 16 May 2008
Posts: 10

PostPosted: Wed Apr 01, 2009 12:33 pm    Post subject: Reply with quote

Hello Igor,

ok, a sample, taken from our app is on the way.

thx
Torsten
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Fri Apr 03, 2009 5:52 am    Post subject: Reply with quote

Hi Torsten,

Thank you for the files.
It looks like the following works fine under D2009:
1. Set StoreAsUtf8=True for datamodule.
2. Save it to SIB file.
3. Check the content of SIB file in SIL Editor and it should be fine.

Please let me know if this helps.
Back to top
View user's profile Send private message
tportoff



Joined: 16 May 2008
Posts: 10

PostPosted: Fri Apr 03, 2009 3:16 pm    Post subject: Reply with quote

Hello Igor,

you are right. Setting StoreAsUTF8 to TRUE produced a valid SIB file. No question marks for russian chars...but that is only the half way.

- At runtime, after loading the translations back i got question marks again. No matter if StoreAsUTF8 is true or false. The result is always the same.

- I have also used the IDE Editor to load the SIB file. That works, but at runtime i got question marks.

- If i set StoreAsUTF8 back to false, don't load the translations from the SIB file and use the translations stored in the DFM file everything works like it worked before.

So, i must set StoreAsUTF8 to true, to create valid SIB Files. Then i have to set StoreAsUTF8 back to false, otherwise ... question marks.
Now, one can use the SIB File with the SIL-Editor to perform translations. After this work is finished i can use the IDE Editor lo get the translations back in the IDE. The problem is, that the translator is not able to test his work, because loading the SIB back during runtime fails.

In my opinion there is actually no easy way to store translations from DataModules in external files and reuse them in any way. Not with DataModules coming from older Delphi Versions, if this is the problem.

The only way i found is, to move all siComponents to a form. But that is a horrible job and may have side effects. Do you know a way to safely convert DataModules to Forms? Our app contains about 30 DataModuls and all have an TsiLangLinked.

I think, the best is, i wait for the next version of the siComponents, I'm sure you will find a way to solve problems like this. May be, you add a list of Fonts, Charsets and language names to the dispatcher. These informations can be used as defaults fr everything that has no charset information.

thx,
Torsten
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2095

PostPosted: Mon Apr 06, 2009 7:35 am    Post subject: Reply with quote

Hello Torsten,

We will try to find a way to improve this. But actually it is already works with StoreAsUtf8=true. I've sent you sample project with your datamodule which demonstrates this.
Please let us know how it works on your side.
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