LoadAll - empty strings

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
wcizmowski
Posts: 19
Joined: Thu Sep 13, 2007 12:50 pm

LoadAll - empty strings

Post by wcizmowski »

hello,
i have a problem with siLangDispatcher.LoadAll function.
before LoadAll in my section [Strings] i have english strings and if i call LoadAll for other language, i lost non-empty english string if ohter language strings are empty.
It work fine for [Captions] and [Hints] : LoadAll save prevoius translations if new are empty, but for [Strings] is problem...
Please help me.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

Which language is default (the first one)? Could you please create a sample project that reproduces the problem and send it to us? Because we've tried to reproduce this situation without luck.
Best regards,
Igor Siticov.
wcizmowski
Posts: 19
Joined: Thu Sep 13, 2007 12:50 pm

Post by wcizmowski »

So,
Originally i have only one language, english,
With LoadAll i load new .sib file (with one another language)

ok, i will prepare sample project and will send it to your support.
wcizmowski
Posts: 19
Joined: Thu Sep 13, 2007 12:50 pm

Post by wcizmowski »

Hello,
This is sample project (Delphi 2007):
(I was send sample project to supprt,If you need please send me info, i will send you directy via email, it is 370Kb)

short description:
If you run this sample:
- please click „polish” button : only label2 will be translated, IT IS OK
- but STRING1 from section Strings is replaced with empty string : this is problem

function LoadAll replace strings with empty values : in polish.sil file STRING1 is empty
but Captions are OK – are empty too in polish.sib (exception label2)

PLEASE HELP ME.
Last edited by wcizmowski on Fri May 30, 2008 12:31 pm, edited 2 times in total.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

Thank you for the sample project. It a little bit differs from what you described earlier. Actually, this behavior is as designed. When you load translations from external file all existing translations deleted. For Captions, Hints and other sections the English words remain because they are in components' properties. So TsiLang just pick-ups them again from there. But if you load string for Strings section, which has empty translations it will replace existing translations with empty value.
Best regards,
Igor Siticov.
wcizmowski
Posts: 19
Joined: Thu Sep 13, 2007 12:50 pm

Post by wcizmowski »

Hello,
So, it is not possible to keep Strings ?
Maybe is the way to modify something in siComp.pas ?
In this moment i dont have idea to modify your sources, can you help me with this?
it is very important problem for us.
We have many languages, but not all strings are translated.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Actually, changing this behavior will require a lot of modifications and also I don't think it is correct to change it.
The only solution I see now (and almost all users use such approach) is to have ALWAYS in your SIL\SIB files at least default (first one) language. Why do you remove English values from the translations when translating?
Untranslated means that the string is in some base language, but you delete it at all.
Best regards,
Igor Siticov.
wcizmowski
Posts: 19
Joined: Thu Sep 13, 2007 12:50 pm

Post by wcizmowski »

isiticov wrote:Actually, changing this behavior will require a lot of modifications and also I don't think it is correct to change it.
so, I think is possible and will be nice. in my opinion enough is modify LoadFromStream function in siComp.pas. It is correct?
isiticov wrote: Why do you remove English values from the translations when translating?
Untranslated means that the string is in some base language, but you delete it at all.
I remove English, because we have 18 languages and our decision is: create 18 SIB files. One file have one language. It is easy I think and clear to make translations.

So, in this time i must keep English translations in each language (SIB) file? It is no another way? Please confirm.
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

So, in this time i must keep English translations in each language (SIB) file? It is no another way? Please confirm.
Yes, you will need to have at least English for strings, otherwise they won't be translated.
in my opinion enough is modify LoadFromStream function in siComp.pas. It is correct?
Yes, but please note, that your modifications will be "on your side" only. And may be lost if you update to the later releases.
Best regards,
Igor Siticov.
wcizmowski
Posts: 19
Joined: Thu Sep 13, 2007 12:50 pm

Post by wcizmowski »

isiticov wrote: Yes, but please note, that your modifications will be "on your side" only. And may be lost if you update to the later releases.
This is ok for me at this time. Can you help me with this modofication?
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Can you help me with this modofication?
I can just give you some hints:
1. All your modifications must care if PropType = stStrings
2. You may want to not use
p_Strings.Clear;
3. Later after ReadString you need to analyze the just read string and decide replace the same in the list or not.

Hope this helps.
Best regards,
Igor Siticov.
wcizmowski
Posts: 19
Joined: Thu Sep 13, 2007 12:50 pm

Post by wcizmowski »

hello Igor,
you have important email from me.
i need your help with this modyfications, because is not easy for me.
please read.
Post Reply