.NET Globalization and Satellite DLL

I am working on localizing an application that I wrote in C #.

Everything seems to work well, using satellite resource assemblies to translate lines of each form (according to this guide: http://msdn.microsoft.com/en-us/library/y99d1cd3%28VS.71%29.aspx )

However, the application will ultimately require quite a few languages, which means downloading directories in my working directory (i.e. / zh-tw, / zh-cn, / fr-FR, / ja-JP, etc.). I would clean it up a bit by finding all of them in the / languages โ€‹โ€‹or / resources subdirectory (in other words, set the "base path for satellite assemblies"). But I searched high and low, and could not find a way to adjust the location of these satellite assemblies.

Any advice would be greatly appreciated!

+6
c # resources localization globalization
source share
4 answers

Found an even simpler solution - in app.config:

<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath=".;Lang" /> </assemblyBinding> </runtime> </configuration> 

Then you can just drop all of these discs in the โ€œLangโ€ subdirectory, and it will work right out of the box! The event after the assembly is also convenient to copy into them after compilation :)

+11
source share

IMHO, I would not change anything here. There is a standard localization mechanism in .NET, which is based on satellite dlls and these subdirectories. If you use a localization tool, for example. Passolo, he will also support precisely this structure and nothing more.

There will be many subdirectories ... so what? Everything else will be quite complicated.

+1
source share

Add all your resource files (i.e. * .resx) to the / Resources folder and create a ResourceManager object as shown below

System.Resources.ResourceManager rm = new System.Resources.ResourceManager ("ApplicationName.Resources.MyResource", Assembly.GetExecutingAssembly ());

It is said here that for lang de-DE your resx file will be called MyResource.de-DE.resx

0
source share

All Articles