4

I have created a application with localization using visual studio 2008 and .net compact framework 3.5 on windows mobile 6.1. To achieve localization, I have used many resource file for this, one for each langauge :

StringResources.de-DE.resx

StringResources.es-ES.resx

StringResources.en-GB.resx

StringResources.fr-FR.resx

StringResources.nl-NL.resx

I also have a StringResources.resx file with default strings for fallback in case other culture not supported by my app is chosen.

I have also created a .cab file by using a "SmartDeviceCabProject" (vdproj type) to perform installation of this application on the device. (using msdn.microsoft.com/en-us/library/aa446504.aspx)

Here is the problem that I am facing: When I change the culture to anything other than the nl-NL, I always get default strings.

Please also note that when I copy paste the "bin" folder of the application into the device, all culture strings are seen. Only when application is installed via the cab file that the problem occurs.

Also if i remove the StringResources.nl-NL.resx file and only have

StringResources.de-DE.resx

StringResources.es-ES.resx

StringResources.en-GB.resx

StringResources.fr-FR.resx

as the culture specific resources and recreate the cab file, now see that when I change the culture to anything other than the fr-FR, I always get default strings. So only the last culture file is effective always.

Just to be sure I diffed the dlls that were installed in each of the culture folders via the cab file on the device : de-DE\Application.StringResources.dll

es-ES\Application.StringResources.dll

en-GB\Application.StringResources.dll

fr-FR\Application.StringResources.dll

nl-NL\Application.StringResources.dll

Strangely I found all the dlls are exact same. However if I diff the dlls present in the "bin" folder, they are found to be different.

Thus I believe that the .cab file build is causing the same DLL to be copied to each folder.

With the above explanation in mind, please help me with :

**1. What do I do to make the cab file install the proper DLLs to the folders?

  1. Is there any other way to place the correct dlls?

  2. IS there any other way to achieve localization?**

Vicky
  • 1,107
  • 2
  • 13
  • 25
  • The last 3 help requests make little sense. The real problem of course is that the *same* file is copied. Something wrong with the way you made the .cab, you didn't describe how it's done. – Hans Passant Jan 12 '11 at 19:40
  • I have added a new project of the type "Smart Device Cab project" to the solution. To this cab file i have added the output of application and local resources of application as files to be installed. this is done using the method described in : http://msdn.microsoft.com/en-us/library/aa446504.aspx – Vicky Jan 12 '11 at 19:55

1 Answers1

6

This problem is registered as a bug in WizCab.exe: Smart Device CAB Project includes wrong localized resources.

I have found that the best way around the problem is to:

  1. Add post-build events to the projects with localized resources that copies the resources files to unique (file) names:

    copy "$(TargetDir)sv\$(TargetName).resources.dll" "$(TargetDir)sv\sv_$(TargetName).resources.dll"

    for each present language.

  2. perform a build and overwrite these unique resource files with an empty file - otherwise the visual studio GUI will not allow you to rename (step 4) the added files.

  3. Add the copied localized assemblies as files (right click on .cab-project and choose "View" -> "File System") under "Application Folder" to the correct localization folders instead of using references to project output.

  4. Rename the added assemblies in the "File System view" back to their original names ("YourProject.resources.dll".)

Not very nice but it works.

Johan Kullbom
  • 4,183
  • 26
  • 28