简体   繁体   English

C#本地化不适用于中文操作系统,但适用于中文语言包

[英]C# localization not working in Chinese OS but works on Chinese language pack

I have an application which uses resource files to localize text. 我有一个使用资源文件本地化文本的应用程序。 The EXE is in a separate project and resources are in separate project. EXE在单独的项目中,资源在单独的项目中。 When deployed on English OS with Chinese language pack it works fine, but when deployed on complete Chinese OS it does not show Chinese text. 在带有中文语言包的英文OS上部署时,它可以正常工作,但是在完整的中文OS上部署时,它不显示中文文本。 I did a assembly binding logging, and found out that the system looks for zh-cn dll and this dll is successfully found and loaded. 我进行了程序集绑定日志记录,发现系统正在查找zh-cn dll,并且已成功找到并加载了该dll。

If it queries for the DLL why does it still fall back to English? 如果它查询DLL,为什么还回到英文? The only reason it would do this is that it does not find the queried string. 这样做的唯一原因是它找不到所查询的字符串。 Any ideas whats going wrong? 任何想法出什么事了吗?

I am using the standard resource files with PublicResXFileCodeGenerator to compile my resources and I am using resource properties to refer to the string, also I am not explicitly passing any culture information. 我正在使用带有PublicResXFileCodeGenerator的标准资源文件来编译我的资源,并且正在使用资源属性来引用该字符串,而且我也没有明确传递任何区域性信息。

My problem is solved. 我的问题解决了。 Here's what had happened. 这就是发生的事情。 Our build script sets authenticode signing on all DLLs, we had not authenticode signed the zh-cn and ja resource dlls. 我们的构建脚本在所有DLL上设置了authenticode签名,但尚未对zh-cn和ja资源dll进行authenticode签名。 So looks like .net was not picking up the DLL and defaulting to english. 因此,看起来.net并未选择DLL并默认为英语。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM