Page 1 of 1

CONST section translation question

Posted: Mon Sep 10, 2012 8:59 am
by gmatrix
Hi,

After using TSILang to translate the const section inside a datamodule in our project, I've found the following line in our source code:

GMRSDlgsM00000056: string = 'This process can take a few minutes or a few hours depending on the disk size, number of drives selected and the secure erasure method selected'#13+ // TSI: Localized (Don't modify!)
'Do you wish to continue?';


on the other side under UpdateStrings procedure I found the following line:

GMRSDlgsM00000056 := siLang1.GetTextOrDefault('strGMRSDlgsM00000056' (* 'This process can take a few minutes or a few hours depending on the disk size, number of drives selected and the secure erasure method selected
Do you want to continue?' *) );


Now what confuses me is that normally TSilang components generate first line as for example:
GMRSCaption00000022: string = ''; (* Decompressing... *) // TSI: Localized (Don't modify!)

no data between '' and only text is marked between the two brackets, yet for GMRSDlgsM00000056 it looks strange, so is this an error that I should fix? and if yes how?

Thanks for your time

Michael

Posted: Mon Sep 10, 2012 9:34 am
by isiticov
There is an option in TsiLang Expert settings (section Source Strings) named "Empty values after replacement" which will empty the initial string value atfer modifying source code. This is done for reducing the size of EXE, but at the same time if you delete TsiLang from your source this might cause invalid behaviour. So if the EXE size not so important we would recommend to switch OFF this option and have strings constants always initialized. You can leave all as it is now if you don't plan to remove TsiLang from your project and everything will work just fine.

Posted: Mon Sep 10, 2012 9:39 am
by gmatrix
isiticov wrote:There is an option in TsiLang Expert settings (section Source Strings) named "Empty values after replacement" which will empty the initial string value atfer modifying source code. This is done for reducing the size of EXE, but at the same time if you delete TsiLang from your source this might cause invalid behaviour. So if the EXE size not so important we would recommend to switch OFF this option and have strings constants always initialized. You can leave all as it is now if you don't plan to remove TsiLang from your project and everything will work just fine.
I am sorry I didn't understand this part...if TsiLang Expert settings (section Source Strings) >> Empty values after replacement is already enabled, then why it didn't empty the string in

GMRSDlgsM00000056: string = 'This process can take a few minutes or a few hours depending on the disk size, number of drives selected and the secure erasure method selected'#13+ // TSI: Localized (Don't modify!)
'Do you wish to continue?';

Actually that is what is confusing me here as out of 100+ lines, the above line is the ONLY line that has the string initialized, so I am trying to figure out what could be wrong?

Could it be because of the #13+? and if yes what is the proper way to have it inside a string so that I can get a new line between two senstences

Thanks for your time

Posted: Mon Sep 10, 2012 11:19 am
by isiticov
May be when you localized this string this option was OFF and later you turned it ON. Expert doesn't modify strings marked with "// TSI: Localized (Don't modify!)" as it supposes it was already localized.

Posted: Mon Sep 10, 2012 11:28 am
by gmatrix
isiticov wrote:May be when you localized this string this option was OFF and later you turned it ON. Expert doesn't modify strings marked with "// TSI: Localized (Don't modify!)" as it supposes it was already localized.
No the option was ON and it was not marked with TSI: Localized (Don't Modify!)

and that's what's confusing me a lot, as I am 100% sure it was was just a regular string just like any other string, only difference is that it had the #13+ but I don't think it will make any difference

On all cases shall I empty the string manually?

Please let me know your thoughts

Posted: Mon Sep 10, 2012 11:36 am
by isiticov
If you wish to empty strings in CONST setion then you can empty it manually. If you don't wish to empty strings in CONST then just leave it as is. As long as its translation is in TsiLang and it is updated in UpdateStrings() method the initial value isn't important.