.NET全球化和放大器;卫星DLL的 [英] .NET Globalization & Satellite DLL's

查看:212
本文介绍了.NET全球化和放大器;卫星DLL的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的本地化的应用程序,我写在C#。

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

一切似乎很好地工作,利用卫星资源集翻译各种形式的字符串(按照本教程:的 http://msdn.microsoft.com/en-us/library/y99d1cd3%28VS.71%29.aspx

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)

但是,应用程序最终将需要相当多的语言,这意味着目录的负载在我的工作目录(例如/ ZH-TW,/ ZH-CN / FR-FR,/ JA-JP,等)。我想通过在一个/语言或/资源子目录中查找所有的人都进行清洁了一下(换句话说,设置附属程序集的基本路径)。但我已经搜查高和低,一直无法找到任何方式来定制这些附属程序集的位置。

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.

任何提示将不胜AP preciated!

Any tips would be greatly appreciated!

推荐答案

找到一种更简单的解决方案 - 在app.config中:

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 :)

这篇关于.NET全球化和放大器;卫星DLL的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆