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
Using localized resources (subfolders?) for MFC, C++ - 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: Fri Feb 5th, 2010 02:39 pm
PM Private Upload Quote Reply
Christine
Member
 

Joined: Tue Nov 20th, 2007
Location:  
Posts: 183
Status: 
Offline
Dear all,

my software developer colleague got a bit stuck, maybe you could help. So far, we are using multilanguage files for MFC code. We would like to switch to separate resource files, ideally in a subfolder. We tried the following:

Without a subfolder (option "<body><mfc>.dll"), setting the language seems to be working out of the box, i. e. the correct language is used by the application.

However, with option "<sl>\<body><mfc>.dll", see screenshot, it does not. Only the original strings are shown.

(We are calling languages with Country = Neutral, i. e. without sublanguages.)

It would be very nice if you could give us a hint or a link to a documentation on the matter.

Thanks very much in advance, Christine



Attachment: Sisulizer_Visual++Settings.png (Downloaded 22 times)

Back To Top PM Private Upload Quote Reply

 Posted: Fri Feb 5th, 2010 02:56 pm
PM Private Upload Quote Reply
Janusz Grzybek
Super Moderator


Joined: Fri Dec 1st, 2006
Location: Zabrze, Poland
Posts: 2542
Status: 
Offline
MFC always looking for resource dlls in exe directory. If MFC doesn't find appropriated DLL, used are resources from exe file. This is MFC limitation.

Best,
Janusz



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

 Posted: Fri Feb 5th, 2010 03:01 pm
PM Private Upload Quote Reply
Janusz Grzybek
Super Moderator


Joined: Fri Dec 1st, 2006
Location: Zabrze, Poland
Posts: 2542
Status: 
Offline
More information about MFC's resource DLLs you can find in this topic of our online help:
http://www.sisulizer.com/online-help/MfcResourceDllFiles.htm

Best,
Janusz



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

 Posted: Fri Feb 5th, 2010 03:05 pm
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2115
Status: 
Offline
Hi,

To my knowledge does the MFC handle the loading of the language files. So the default file pattern in Sisulizer is in the way the MFC wants to see the files at runtime. That is the reason why it finds the files if you are following the default and it doesn't if you "hide" them in a sub dir. btw: in .NET this was changed. there the resource files have to be in sub dirs. Perhaps because so many customers requested sub dirs?...

Markus




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

 Posted: Fri Feb 5th, 2010 03:20 pm
PM Private Upload Quote Reply
Christine
Member
 

Joined: Tue Nov 20th, 2007
Location:  
Posts: 183
Status: 
Offline
Ok, thanks a lot for the clarification and fast response!!!

Christine

Back To Top PM Private Upload Quote Reply

 Posted: Fri Feb 5th, 2010 03:22 pm
PM Private Upload Quote Reply
Christine
Member
 

Joined: Tue Nov 20th, 2007
Location:  
Posts: 183
Status: 
Offline
_(at)_Markus:
Yeah, our other projects are in DotNet, that's much better...

Actually, we will have several hundreds of MFC resources in our main program folder, that's simply not so very convenient. So I spotted the option in Sisulizer and thought maybe there is a way we did not think about.

Back To Top PM Private Upload Quote Reply

 Posted: Fri Feb 5th, 2010 03:42 pm
PM Private Upload Quote Reply
Markus.Kreisel
Administrator


Joined: Sat Apr 8th, 2006
Location: Monschau, Germany
Posts: 2115
Status: 
Offline
Perhaps you could link these resources into a big one before you localize them?
I'm not a MFC developer so please don't hit me if this impossible due to some reason :-)

Markus



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

 Posted: Tue Mar 9th, 2010 12:07 am
PM Private Upload Quote Reply
ngallimore
Member
 

Joined: Wed Nov 11th, 2009
Location: Brisbane, Australia
Posts: 7
Status: 
Offline
Hi Christine,

There are actually two ways to achieve this. Both require some tampering with the way that MFC loads resources, but fortunately MFC is set up to allow that tampering so it's fairly low-risk.

The first option is to override CWinApp::LoadAppLangResourceDLL in your CWinApp-derived class. If you look at the default implementation of this in the MFC source (in C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\appcore.cpp) it is fairly simple: figure out the path and filename of the principle executable, and pass that to AfxLoadLangResourceDLL. By overriding this and supplying your own path and then calling AfxLoadLangResourceDLL manually, you can force MFC to load resources from a subdirectory.

The second option is to bypass or override the loading of the resources entirely by directly setting CWinApp::m_hLangResourceDLL, which is the handle of the satellite resource DLL to use (and is protected, so can be directly modified from your CWinApp-derived class). This allows you to completely use your own logic to track down whichever resource DLL you wish to use. Just make sure to call ::FreeLibrary on the previous value before overwriting it, otherwise you'll get a memory leak.

Hope this helps. It's all based on VS2008, but should be adaptable to previous versions should that be an issue. Let me know if you need more info.

Regards,

Nick

Back To Top PM Private Upload Quote Reply

Current time is 06:26 am  
.NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Usage - Three simple steps to localize > Using localized resources (subfolders?) for MFC, C++



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