|
|||
|
Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... > Technical Support (You need to be registered at the forum to write) > Usage - Three simple steps to localize > Exclude translation of TLabel component with name lblNotTranslate
|
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius | Page: 1 2 |
|
||||||||||||
| Exclude translation of TLabel component with name lblNotTranslate - Usage - Three simple steps to localize - Technical Support (You need to be registered at the forum to write) - Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... | ||||||||||||||
| Author | Post | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||
|
starvisitor Member
|
Hello! I write a little delphi application an I use OnGuard to protect my application. OnGuard components make it possible to make a demo version from your application, an I use it inside Delphi 2007 (OgUsage). The users can start my app 30 times, then they have to register. This status informations are shown dynamically with a TLabel component and it's property "Caption" Like... lblRegistrationCap.Font.Color := clGreen; lblRegistrationCap.Caption := RegisteredCap; RegisteredCap is a dynamic String Value. If I use now Sisulizer to translate my application to english, the lblRegistrationCap.Caption losts all registration status information - text. How can I exclude this exact component "lblRegistrationCap" for translations? The registration text-informations for users should not lost after a dynamically language change. Notice: The registration string informations declared in variable "RegisteredCap" are not resourcestrings and so are excluded for translations so that can not be the problem. Please help me to fix this "effect".
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
Markus.Kreisel Administrator
|
Hi, have you tried: Tools - Platforms - VCL - Properties? There you can exclude "lblRegistrationCap.Caption" from scanning. Hope this helps Markus
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
starvisitor Member
|
Hello! Not really - If I put this control to Tools - Platforms - VCL - Properties Sisulizer excludes me all components with property "Caption", so my app translation will not work for the other Label elements... Other idea?
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
Markus.Kreisel Administrator
|
You excluded "Caption"? Please try to exclude "lblRegistrationCap.Caption" You should be also able to exclude "lblRegistrationCap.*". Doesn't that work for you? Best Markus
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
starvisitor Member
|
I have done it but if I build Sisulizer and start my exe, change language the effect happens again. Here I have but the Screen where I have placed your solution. But it does not work for me... Attachment: lblExclude.jpg (Downloaded 38 times)
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
Markus.Kreisel Administrator
|
Have you used "Scan For Chnages" after your change to the settings and before you build your EXE again? Did Sisulizer mark the row with the unwanted string with a blue dot (unused) after Scan for Changes? (You might want to use Project - Remove unused strings to remove the row completely from the project). Does this help? Markus
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
starvisitor Member
|
Here the "effect" Screens I have after changing language... Attachment: problem-exclude-lblRegistra.jpg (Downloaded 38 times)
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
Ilkka.Salmenius Administrator
|
Adding "lblRegistrationCap.*" to excluded proprties won't work because lblRegistrationCap is name of a component. There can be only property names in the list. You have to exclude your lblRegistrationCap.Caption row by row. Do you have a lblRegistrationCap labels in several Delphi forms? Or just in one form? Attachment: Row.PNG (Downloaded 37 times)
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
starvisitor Member
|
Yes I have exclude any row like your screen show now, have then scan sisulizer for changes, then build again. After starting my app - same effect as ever. I have the same effect on Combobox - TString Items too. They lost her default setting values... How can I fix this bad "effect"? Please help me...Thanks
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
Ilkka.Salmenius Administrator
|
If possible, could you send your SLP file and the EXE file to me. support (at) sisulizer.fi
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
starvisitor Member
|
Ok, but use it absolutely confiding...is that ok for you??
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
Ilkka.Salmenius Administrator
|
Of course. Allways. I will delete all files from my computer after the case is solved. best regards Ilkka
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
starvisitor Member
|
Ok, give me 5 minutes please - then you will have a email from me ;-)
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
starvisitor Member
|
you have post now. please send me back only to my email-address if you wishes to contact me...thanks for help!
|
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
starvisitor Member
|
sorry I have forgotten the slp file - i will send it now!
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
Ilkka.Salmenius Administrator
|
Now I got your point. You are changing the language on runtime. When a language has been changed it will replace all the properties with new values. That's why lblRegistrationCap.Caption will be overwritten with the value that has been saved to the DFM file. In your case it is "Registration infos show here!" You have two choices. 1. In Delphi IDE clear the Caption "Registration infos show here!". After that no Caption property will be stored to DFM file. Loding the new language doesn't overwrite the existing value. 2. After changing the language on runtime reassign the Caption property. regards Ilkka
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
starvisitor Member
|
Ok, thanks. Then I will test it with choice 1., because the timer lefts 1 value each time you start my application in demo mode. So I will set the caption property to blank and leave it empty. I will try it out and give you feedback... thanks for help!
|
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
starvisitor Member
|
I have to change some details on code. But it works now. Thanks for your help!!! Regards from germany starvisitor
|
|||||||||||||
| ||||||||||||||
|
||||||||||||||
|
Jaakko.Salmenius Administrator
|
There is one other way to control what to translate. LaTranslator unit contains global event called LaBeforeTranslate. You can use it to disable translation of a property or component. Add the following code to your main form. procedure BeforeTranslate( host: TComponent; obj: TObject; propertyInfo: PPropInfo; const currentValue: Variant; var newValue: Variant; var cancel: Boolean); begin cancel := obj = Form1.lblRegistrationCap; end; This is an event that TLaTranslator calls evey time before it assigns a translated property value. If you set cancel property to False TLaTranslator does not assign the property but its value remains in the current state. You also have to assing the event to TLaTranslator by using the following code in your main form. initialization LaBeforeTranslate := BeforeTranslate; end. <sldir>\VCL\DelphiWin\Events contains a sample that demonstrates this. Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
|||||||||||||
| ||||||||||||||
| ||||||||||||||
|
starvisitor Member
|
Hello Jaakko! I have implement your solution, gave lblRegistrationCap the initialize caption value "Registration infos show here!" back, and implement this code: +++++++++++++++++++++++++++++++++++++++++++ procedure BeforeTranslate(host: TComponent; obj: TObject; propertyInfo: PPropInfo; const currentValue: Variant; var newValue: Variant; var cancel: Boolean); begin cancel := obj = Form1.lblRegistrationCap; cancel := obj = Form1.cboJComp; cancel := obj = Form1.cboRes; end; initialization LaBeforeTranslate := BeforeTranslate; ++++++++++++++++++++++++++++++++++++++++++++++ Build my exe, run it and...the "effect" comes again. Your solution is more flexible, but it don't work for me. Have you an answer for that? Thanks for your helping hand! starvisitor
|
|||||||||||||
| ||||||||||||||
| Current time is 08:05 am | Page: 1 2 |
| Localization Tool for VB, Delphi, .NET, C#, VB.NET, XML, Online Help, HTML ... > Technical Support (You need to be registered at the forum to write) > Usage - Three simple steps to localize > Exclude translation of TLabel component with name lblNotTranslate | |
Sisulizer software localization tool - Three simple steps to localize