![]() |
Localization |
Post Reply ![]() |
Author | |
eggbox ![]() Groupie ![]() ![]() Joined: 10 March 2006 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() Posted: 10 December 2008 at 3:47pm |
We need to create a localized version of our software (to Japanese), our code is setup with satellite resource DLLs. We ship both English and Japanese DLLs to our customers and let them decide which language to use.
Where can I get information about how Codejock handles localization, do I need to create Codejock resource DLLs or do I need to ship 2 versions of the DLLs (one for English and one for Japanese). Then, how do I load the correct one (resource DLLs or DLL) at runtime? Any pointers would be greatly appreciated. |
|
//*eggbox
Product: Xtreme ToolkitPro v18.2.0 Platform: Windows 7 (32 bit) Language: C++ / MFC |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
We also have Dlls for languages. A separate Dll for each language. Basically you just specify which Dll to use and that is it, only a few lines of code. The Resource Editor shows all internal strings that are translated, and if they are not translated you can use that utility to do that yourself.
So you can also change our language Dll on the fly, they are small so you can ship them both. First, you can edit the Dlls using out Resource Editor utility: "C:\Program Files\Codejock Software\MFC\Xtreme ToolkitPro v12.1.1\Utils\ResourceEditor.exe" There are 2 samples that show how to use them: This sample just used the Dlls: "C:\Program Files\Codejock Software\MFC\Xtreme ToolkitPro v12.1.1\Samples\ToolkitPro\MultiLanguage\MultiLanguage_vc60.dsw" This sample shows how you can change all strings in the application, not just those stored in our Dll: "C:\Program Files\Codejock Software\MFC\Xtreme ToolkitPro v12.1.1\Samples\CommandBars\ScribbleMultiLang\Scribble_vc60.dsw" Hope this helps |
|
![]() |
|
eggbox ![]() Groupie ![]() ![]() Joined: 10 March 2006 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
Thanks for the information, I understand how these sample work but (I think) this is not what I need to do, i.e. control all the resources using codejock, we have an existing mechanism to do this for our resource files/dlls.
I am looking at the resources in the codejock source code for codejock controls, e.g. the PropertyGrid. In this example I can see there is a resource file; Resource.rc that contains text for 3 items that are shown in the property grid. There are also language resource files which have different names, e.g. Resource_ja.rc for Japanese. So, I go to the Workspace/Resource folder and compile the resources which creates a bunch of DLLs in the bin/translations folder. Assuming I only want Japanese, how do I use these DLLs? Thanks |
|
//*eggbox
Product: Xtreme ToolkitPro v18.2.0 Platform: Windows 7 (32 bit) Language: C++ / MFC |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Yes, the Dlls contain only strings of the Toolkit that the developer can't change in code. In this case you would need the Japanese and English Dlls.
The first sample I recommended shows how to use them: "C:\Program Files\Codejock Software\MFC\Xtreme ToolkitPro v12.1.1\Samples\ToolkitPro\MultiLanguage\MultiLanguage_vc60.dsw" All you need is load Language dll: if (m_hModule) { ::FreeLibrary(m_hModule); m_hModule = 0; } m_hModule = ::LoadLibrary(lpszDllPath); XTPResourceManager()->SetResourceHandle(m_hModule); |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
If you only need Japanese version and don't need switch resources in runtime:
Add 1. in res\app.rc2 file add #define _XTP_RESOURCE_LANGUAGE ja #include "XTToolkitPro.rc" 2. in BOOL CYourApp::InitInstance() add XTPResourceManager()->SetResourceHandle(AfxGetInstanceHandle()); |
|
![]() |
|
eggbox ![]() Groupie ![]() ![]() Joined: 10 March 2006 Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
Ok, that makes a more sense.
One final question, does the toolkit contain the English resources, because we do not ship any resource we just ship the toolkit DLL and the strings for toolkit controls are all in place.
Thanks again for your prompt response.
|
|
//*eggbox
Product: Xtreme ToolkitPro v18.2.0 Platform: Windows 7 (32 bit) Language: C++ / MFC |
|
![]() |
|
jeremyspiegel ![]() Newbie ![]() Joined: 15 January 2009 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
I'm doing something similar and am in need of some help. We also build localized resource DLLs and load them at runtime when our app starts up. We build and load these resource DLLs not only to localize our
application, but also to allow partners to rebrand our application
through the resource DLL mechanism.
We currently accomplish this by doing a AfxSetResourceHandle( LoadLibrary( <localized resource dll> ) ). Now that we've adopted Codejock, it looks like we're just supposed to include the localized codejock resources when building our localized resource DLLs and things will just work. This seems like it could be a problem for us though. We need to allow our localization partners and our rebranding partners to build the resource DLL themselves to verify the quality of the localization/rebranding. This allows them to see if controls are positioned correctly in dialog boxes, for example. In order to do this, we have been sending them our own resource files to run through the resource compiler to produce the resource DLL. But now with Codejock it seems we would need to give them the Codejock resource files as well, which it appears is against the Codejock license agreement. As an alternative, I tried building the Codejock resources as part of our main executable, and setting Codejock's XTPResourceManager singleton to use the main executable for resources instead of the resource DLL. We still set the MFC resource handle to the satellite DLL. This works somewhat since much of Codejock's code goes through the XTPResourceManager() singleton to load resources. However, there is still a good amount of Codejock code (version 12.0.2) that goes straight to MFC to load resources (CXTPShortcutBarPaintManager::CXTPShortcutBarPaintManager for example). This fails when the codejock resources aren't included in our satellite resource DLLs. Is there a recommendation for the best way to handle this? :) Jeremy |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |