LoadAll - empty strings
-
- Posts: 19
- Joined: Thu Sep 13, 2007 12:50 pm
LoadAll - empty strings
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.
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.
-
- Posts: 19
- Joined: Thu Sep 13, 2007 12:50 pm
-
- Posts: 19
- Joined: Thu Sep 13, 2007 12:50 pm
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.
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.
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.
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.
Igor Siticov.
-
- Posts: 19
- Joined: Thu Sep 13, 2007 12:50 pm
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.
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.
Igor Siticov.
-
- Posts: 19
- Joined: Thu Sep 13, 2007 12:50 pm
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:Actually, changing this behavior will require a lot of modifications and also I don't think it is correct to change it.
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.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.
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.So, in this time i must keep English translations in each language (SIB) file? It is no another way? Please confirm.
Yes, but please note, that your modifications will be "on your side" only. And may be lost if you update to the later releases.in my opinion enough is modify LoadFromStream function in siComp.pas. It is correct?
Best regards,
Igor Siticov.
Igor Siticov.
-
- Posts: 19
- Joined: Thu Sep 13, 2007 12:50 pm
I can just give you some hints:Can you help me with this modofication?
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.
Igor Siticov.
-
- Posts: 19
- Joined: Thu Sep 13, 2007 12:50 pm