Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Globalization & Satellite DLL's

I'm working on localizing an app I've written in C#.

Everything seems to be working nicely, using satellite resource assemblies to translate each form's strings (as per this tutorial: http://msdn.microsoft.com/en-us/library/y99d1cd3%28VS.71%29.aspx)

However, the application will ultimately require quite a number of languages, which means loads of directories in my working directory (i.e. /zh-tw, /zh-cn, /fr-FR, /ja-JP, etc). I'd like to clean this up a bit by locating all of them within a /languages or /resources subdirectory (in other words, set the "base path for satellite assemblies"). But I've searched high and low, and been unable to find any way to customize the location of these satellite assemblies.

Any tips would be greatly appreciated!

like image 539
Metal450 Avatar asked Dec 12 '09 05:12

Metal450


People also ask

What is .NET globalization?

Globalization involves designing and developing a world-ready app that supports localized interfaces and regional data for users in multiple cultures. Before beginning the design phase, you should determine which cultures your app will support.

What is localization concept in .NET technology?

Localization is the process of modifying our application to fit within a particular culture.


1 Answers

Found an even easier solution - in app.config:

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

Then you can just toss all those dirs in the "Lang" subdir and it'll work right out of the box! A post-build event is also handy to auto-copy them in there after compilation :)

like image 86
Metal450 Avatar answered Sep 22 '22 01:09

Metal450