Problem with D2009, TsiLang V6.4 and StoreAsUTF8

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
tportoff
Posts: 10
Joined: Fri May 16, 2008 4:42 pm

Problem with D2009, TsiLang V6.4 and StoreAsUTF8

Post by tportoff »

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
tportoff
Posts: 10
Joined: Fri May 16, 2008 4:42 pm

Found the problem, but not the solution

Post by tportoff »

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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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.
Best regards,
Igor Siticov.
tportoff
Posts: 10
Joined: Fri May 16, 2008 4:42 pm

SIL and SIB....

Post by tportoff »

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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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.
Best regards,
Igor Siticov.
tportoff
Posts: 10
Joined: Fri May 16, 2008 4:42 pm

Post by tportoff »

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
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Please send us sample datamodule(s) that reproduce this and we will try to find the origin of the problem.
Best regards,
Igor Siticov.
tportoff
Posts: 10
Joined: Fri May 16, 2008 4:42 pm

Post by tportoff »

Hello Igor,

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

thx
Torsten
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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.
Best regards,
Igor Siticov.
tportoff
Posts: 10
Joined: Fri May 16, 2008 4:42 pm

Post by tportoff »

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 für everything that has no charset information.

thx,
Torsten
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

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.
Best regards,
Igor Siticov.
Post Reply