Page 1 of 1
LoadAll - empty strings
Posted: Thu May 29, 2008 1:22 pm
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.
Posted: Fri May 30, 2008 2:45 am
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.
Posted: Fri May 30, 2008 8:18 am
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.
Posted: Fri May 30, 2008 9:43 am
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.
Posted: Fri May 30, 2008 10:04 am
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.
Posted: Fri May 30, 2008 10:13 am
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.
Posted: Fri May 30, 2008 11:07 am
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.
Posted: Fri May 30, 2008 11:20 am
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.
Posted: Fri May 30, 2008 12:49 pm
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.
Posted: Fri May 30, 2008 12:55 pm
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?
Posted: Fri May 30, 2008 1:15 pm
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.
Posted: Mon Jun 02, 2008 11:23 am
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.