SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CONST section translation question

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
gmatrix



Joined: 09 Sep 2012
Posts: 3

PostPosted: Mon Sep 10, 2012 8:59 am    Post subject: CONST section translation question Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Mon Sep 10, 2012 9:34 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
gmatrix



Joined: 09 Sep 2012
Posts: 3

PostPosted: Mon Sep 10, 2012 9:39 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Mon Sep 10, 2012 11:19 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
gmatrix



Joined: 09 Sep 2012
Posts: 3

PostPosted: Mon Sep 10, 2012 11:28 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2102

PostPosted: Mon Sep 10, 2012 11:36 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group