Support forum of the software localization tool Sisulizer


.NET, Delphi, ... - Sisulizer Localization Tool Support Home

Get in contact with the makers of Sisulizer.
Our forum is open for all questions around Sisulizer from customers and prospects.
Don't hesitate to register and ask. The Sisulizer team will answer ASAP.

Search     Help Home Sisulizer Website Download
Search by username
Not logged in - Login | Register 

 Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius
New Topic Reply Printer Friendly
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
AuthorPost
 Posted: Mon May 12th, 2008 08:20 pm
PM Private Upload Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 201
Status: 
Offline
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

Back To Top PM Private Upload Quote Reply

 Posted: Mon May 12th, 2008 10:40 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
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.
  1. Copy Menus.pas from <delphidir>SourceVCL to your project dir.
  2. Add the copied Menus.pas to your project. This makes Delphi to use your Menus.pas instead of th original Menus unit.
  3. Remove the above array and write a function with the same name
Here is the function:

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
Back To Top PM Private Upload Quote Reply

 Posted: Mon May 12th, 2008 11:03 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
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
Back To Top PM Private Upload Quote Reply

 Posted: Mon May 12th, 2008 11:15 pm
PM Private Upload Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 201
Status: 
Offline
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?

Back To Top PM Private Upload Quote Reply

 Posted: Mon May 12th, 2008 11:20 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Are you using Multilizer components?

TIvTranslator and TIvXXXDictionary?

What version?

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

 Posted: Mon May 12th, 2008 11:31 pm
PM Private Upload Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 201
Status: 
Offline
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

Back To Top PM Private Upload Quote Reply

 Posted: Mon May 12th, 2008 11:34 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
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
Back To Top PM Private Upload Quote Reply

 Posted: Mon May 12th, 2008 11:46 pm
PM Private Upload Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 201
Status: 
Offline
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)

Back To Top PM Private Upload Quote Reply

 Posted: Tue May 13th, 2008 12:02 am
PM Private Upload Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 201
Status: 
Offline
Quick look at Multilizer help seems this was done with Delphi Project File and Multilizer Components...?

Back To Top PM Private Upload Quote Reply

 Posted: Tue May 13th, 2008 12:10 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
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
Back To Top PM Private Upload Quote Reply

 Posted: Tue May 13th, 2008 12:28 am
PM Private Upload Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 201
Status: 
Offline
That's great.  Meantime, mending VCL as you advised is working.

Thanks again, hear from you soon.

Back To Top PM Private Upload Quote Reply

 Posted: Wed May 14th, 2008 09:23 pm
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
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
Back To Top PM Private Upload Quote Reply

 Posted: Sun May 18th, 2008 02:08 am
PM Private Upload Quote Reply
bikemike
Member
 

Joined: Tue Nov 20th, 2007
Location: New Zealand
Posts: 201
Status: 
Offline
Works a treat, thanks.
It's LaMenu though, not LaMenus ;-)

Back To Top PM Private Upload Quote Reply

 Posted: Sun May 18th, 2008 02:23 am
PM Private Upload Quote Reply
Jaakko.Salmenius
Administrator
 

Joined: Sat Apr 8th, 2006
Location: Espoo, Finland
Posts: 2275
Status: 
Offline
Thanks. I fixed to LaMenu in the above sample.

Jaakko



____________________
http://www.sisulizer.com - Three simple steps to localize
Back To Top PM Private Upload Quote Reply

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



WowUltra modified by Sisulizer Copyright © 2007-09 by Jim Hale - Based on WowBB Copyright © 2003-2006 Aycan Gulez

Sisulizer software localization tool - Three simple steps to localize