|
|||
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius |
|
||||||||||||||||
| Delphi 7 consts.pas - Usage - Three simple steps to localize - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support | |||||||||||||||||
| Author | Post | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||
|
bikemike Member
|
I have found that my Localized Delphi 7 application will start with the Sisulizer-translated strings for consts.pas - such as 'Ctrl+' but these are not updated at runtime. I cannot find how the Shortcut keys are assigned in my application so do not know where to hook up a task for post translate... Unless I should be tackling this differently. If I exclude consts from the sisulizer project then there are no translations so there seems to be no delphi-provided translations that should jsut work - I must provide my own..? I see there was a post about getting a glossary for these which would be nice (http://forum.sisulizer.com/view_topic.php?id=335&forum_id=3) but my problem is assuming I should be translating them, how do I reset/reload them after a translate at run time? many thanks
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
There is not easy solution for this. The problem is that VCL stores the values of the resource strings into an array on system start up. The following code is from Menus.pas var MenuKeyCaps: array[TMenuKeyCap] of string = ( SmkcBkSp, SmkcTab, SmkcEsc, SmkcEnter, SmkcSpace, SmkcPgUp, SmkcPgDn, SmkcEnd, SmkcHome, SmkcLeft, SmkcUp, SmkcRight, SmkcDown, SmkcIns, SmkcDel, SmkcShift, SmkcCtrl, SmkcAlt); When you application starts the resource strings contains original value and the array will get those values. If you change the resource DLL the resource strings do change to the new values but the value already copied to the array will remain in the original values. The only solution that i know is to change VCL code. I know this is not a good thing to do but sometimes there is not workaround and the bug must be corrected in the source.
function MenuKeyCaps(value: TMenuKeyCap): String; begin case value of mkcBkSp: Result := SmkcBkSp; mkcTab: Result := SmkcTab; mkcEsc: Result := SmkcEsc; mkcEnter: Result := SmkcEnter; mkcSpace: Result := SmkcSpace; mkcPgUp: Result := SmkcPgUp; mkcPgDn: Result := SmkcPgDn; mkcEnd: Result := SmkcEnd; mkcHome: Result := SmkcHome; mkcLeft: Result := SmkcLeft; mkcUp: Result := SmkcUp; mkcRight: Result := SmkcRight; mkcDown: Result := SmkcDown; mkcIns: Result := SmkcIns; mkcDel: Result := SmkcDel; mkcShift: Result := SmkcShift; mkcCtrl: Result := SmkcCtrl; mkcAlt: Result := SmkcAlt; else Result := ''; end; end; This code works because resource string is fetched every time it is used and if the string changes the function uses the new value. you also have to change all access to MenuKeyCaps[] in Menus to MenuKeyCaps(). I will contact Codegear about this. However I doubt they won't change the code. I will also make a sample and post it to you soon. Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Salmenius Administrator
|
Here is the sample. It does not contain modified Menus.pas because its not your code and we can not send it. You have to take your copy of Menus.pas and do the above changes. Jaakko Attachment: Sample.zip (Downloaded 1 time)
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
bikemike Member
|
Thanks for replying, perfect timing, I just popped out for lunch and come back to a response... But... My Multilizer based version of the software seems to get this right. How does Multilizer manage it?
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Salmenius Administrator
|
Are you using Multilizer components? TIvTranslator and TIvXXXDictionary? What version? Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
bikemike Member
|
Yes, we were. Of course I've pulled them from the new version in progress for Sislulizer. I'm on the point of merging and doing a full project test. I just ran a full pseudo translate (using zulu :-) and have been looking for problems. This was one. Cheers
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
Jaakko.Salmenius Administrator
|
I ment did you use binary localization or component localizarion when using Multilizer. What was your Multilizer version? Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
bikemike Member
|
Multilizer 5.1.112 It looks to be source code localization. I did not set up the project, I have been tasked with replacing it. Attachment may help? Attachment: shot.gif (Downloaded 39 times)
|
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
bikemike Member
|
Quick look at Multilizer help seems this was done with Delphi Project File and Multilizer Components...?
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
Short cuts were translated by Multilizer's TIvTranslator. This is why they got translated. Don't worry. I have already a solution to workaround VCL bug without needing to change VCL code. I let you know when it is finished. Give me few days. Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
bikemike Member
|
That's great. Meantime, mending VCL as you advised is working. Thanks again, hear from you soon.
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
1.6.28 has a new VCL unit called LaMenus.pas. Just add it to your project and add it to a uses clause. implementation uses LaDialog, LaMenu; procedure TForm1.Button1Click(Sender: TObject); begin SelectResourceLocale('EN'); end; end. LaMenu remaps VCL's short cut functions to Sisulizer's multilingual functions that do not cache those strings. In 1.6.28 <sldir>VCLDelphiWinConverter uses this unit. Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
bikemike Member
|
Works a treat, thanks. It's LaMenu though, not LaMenus ;-)
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Jaakko.Salmenius Administrator
|
Thanks. I fixed to LaMenu in the above sample. Jaakko
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
| Current time is 05:44 pm | |
| .NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Usage - Three simple steps to localize > Delphi 7 consts.pas | |
Sisulizer software localization tool - Three simple steps to localize