利用本地化资源文件卡住 [英] Stuck with localization using resource files

查看:167
本文介绍了利用本地化资源文件卡住的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于本地化RESX一个很奇怪的问题。结果
首先,让我解释一下,它是如何为我做的现在。结果
这是ASP.NET MVC项目。我有两个组件:网络和域。网站包含了所有MVC相关的东西,和域,那么,contans域类。此外,在域装配我存储本地化大量静态的资源(我建立的网站可用3种不同的语言)。

I have a very weird problem with resx based localization.
At first, let me explain, how it is done for me right now.
It is ASP.NET MVC project. I have two assemblies: web and domain. Web contains all MVC related stuff, and domain, well, contans domain classes. Also, in domain assembly I store a lot of static resources for localization(I am building site with 3 different languages available).

所以我在这一领域的组装本地化文件夹,并有文件如:结果
CheckoutStrings.resx,CheckoutStrings.en-US.resx,CheckoutStrings.et-EE.resx等。

So I have Localization folder in this domain assembly and there are files like:
CheckoutStrings.resx, CheckoutStrings.en-US.resx, CheckoutStrings.et-EE.resx and so on.

现在奇怪的是,这是所有工作用真的很好我的本地机器上的两个VS开发Server和IIS 7.5。但是,当我上传解决我的Web服务器,它是Windows Server 2008 R2的,所以它是IIS 7.5为好,我的本地化突然停止工作。

Now the weird thing is that this is all working really nicely on my local machine using both VS Developing Server and IIS 7.5. But when I upload solution to my web server, which is Windows Server 2008 R2, so it is IIS 7.5 as well, my localization suddenly stops working.

我试图输出

Thread.CurrentThread.CurrentUICulture

在我的意见,只是输出本地化的字符串前。结果
它给了我选择的文化,这是对的,但仍然字符串呈现为后备值,而不是局部的。

in my views, just before outputting localized strings.
It gives me selected culture, which is right, but nevertheless strings are rendered as a fallback value, not localized one.

我真的坚持在这里,希望任何人有什么线索是在...

I am really stuck here, hope anyone has a clue what is going on...

推荐答案

难道是本地化的文件根本就没有找到,你是回落到了默认语言?你也许部署到GAC在服务器上,但是从/ bin文件夹与您的开发计算机上运行的子文件夹呢?
您是否尝试过使用fuslogvw.exe上看到code从何而来?

Could it be that the localization files are simply not found and you are falling back to the "default language"? Are you maybe deploying into GAC on the server but running it from a /bin folder with subfolders on your dev machine? Have you tried using fuslogvw.exe to see where the code comes from?

请注意,看你有没有做一些注册表黑客的附属程序集的载荷 - 的 http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71)的.aspx

Be aware that to see the loads of satellite assemblies you have to do some registry "hacks" - http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx :

要登录绑定失败卫星
  组件设置
   HKLM \\软件\\微软\\融合\\ LogResourceBinds
  注册表值设置为1(该值是一个
  DWORD)。

To log bind failures to satellite assemblies Set the HKLM\Software\Microsoft\Fusion\LogResourceBinds registry value to 1 (the value is a DWORD).

这篇关于利用本地化资源文件卡住的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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