本地化在Chrome中不起作用

问题描述:

我们正在开发多语言应用程序。不知何故,我们正面临着Chrome浏览器的问题。以下是我在Chrome中所做的语言设置,我甚至将语言移到列表的顶部。 enter image description here本地化在Chrome中不起作用

下面是在web.config enter image description here

设置当我调试它当前区域性返回瑞典,但瑞典的resx文本检索不到。

enter image description here

如果我强迫的UICulture在web.config是 “SV-SE” 它的工作原理。但在“自动”模式下,它不起作用。

以下是resx文件的属性。 enter image description here

请建议我在这里失踪,以使其工作。

我张贴这是一个解决方案,只是因为它为我工作。我不得不从

LocalisedText.es-ES.resx重命名我的resx文件LocalisedText.es.resx

这一点对所有的浏览器为我工作。

我觉得这样的事情会给你当前CultureInfo

CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; 

这就是你想要的?

编辑

尝试

protected void Page_Load(object sender, EventArgs e) 
{ 
    CultureInfo info = System.Threading.Thread.CurrentThread.CurrentCulture; 

    lblMessage.Text = "Culture nane: " + info.Name + "<br />" + 

    "Culture parent name: " + info.Parent.Name + "<br />" + 
    "Display name: " + info.Parent.DisplayName + "<br />" + 
    "English name: " + info.EnglishName + "<br />" + 
    "Native name: " + info.NativeName + "<br />" + 
    "ISO name: " + info.Parent.ThreeLetterISOLanguageName + "<br />" + 
    "Calendar type: " + info.Calendar.ToString(); 

    lblMessage.Text += "<hr />" + DateTime.Now.ToString(); 
} 
+0

我得到了屏幕截图中显示的当前文化。那不是问题。问题是,即使在检测到当前文化后,它也不会从相应的resx文件中获取文本。 –

+0

编辑我的答案,现在检查 –