Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ENG/AR语言的本地化不一致_C#_Jquery_Asp.net_Localization_Arabic - Fatal编程技术网

C# ENG/AR语言的本地化不一致

C# ENG/AR语言的本地化不一致,c#,jquery,asp.net,localization,arabic,C#,Jquery,Asp.net,Localization,Arabic,我一直在一个双语网站上工作,该网站显示阿拉伯语和英语内容。我在App_GlobalResources>>资源文件中存储了阿拉伯语和英语值,名称如下 Messages.ar-LB.resx Messages.resx Syantax用于从全局资源获取数据 Jquery的语法-> "<%= Resources.Messages.userName %>" 我使用的每个页面都继承了我已覆盖InitializeCulture的basepage,我在其中根据用户偏好将当前区域性设置为EN-US

我一直在一个双语网站上工作,该网站显示阿拉伯语和英语内容。我在App_GlobalResources>>资源文件中存储了阿拉伯语和英语值,名称如下

Messages.ar-LB.resx Messages.resx Syantax用于从全局资源获取数据

Jquery的语法->

"<%= Resources.Messages.userName %>"
我使用的每个页面都继承了我已覆盖InitializeCulture的basepage,我在其中根据用户偏好将当前区域性设置为EN-US或AR-LB

问题:-一些页面使用jquery和codebehind正确地呈现阿拉伯语标签,但在其他页面中无法做到。我找不到这些页面之间有任何显著差异

我是不是遗漏了什么

更新: 这就是我设定文化的方式

protected override void InitializeCulture()
    {
         SetCulture("ar-LB","ar-LB"); // Example
    }
protected void SetCulture(string name, string locale)
    {
          // parameters passed here-> (, ar-LB)
          Thread.CurrentThread.CurrentUICulture = new CultureInfo(name);
          Thread.CurrentThread.CurrentCulture = new CultureInfo(locale);
    }

如何设置区域性?@jgauffin:已更新的代码。请尝试禁用缓存或将缓存配置为不同的语言。@jgauffin缓存不会影响Codebehind调用,因为我的Codebehind调用也返回错误的输出。@jgauffin:我可以通过将扩展名从ar LB更改为ar_SA来解决JQUERY问题。我也对Setculture函数进行了更改。然而,codebehind仍然混乱不堪。
Resources.Messages.userName
protected override void InitializeCulture()
    {
         SetCulture("ar-LB","ar-LB"); // Example
    }
protected void SetCulture(string name, string locale)
    {
          // parameters passed here-> (, ar-LB)
          Thread.CurrentThread.CurrentUICulture = new CultureInfo(name);
          Thread.CurrentThread.CurrentCulture = new CultureInfo(locale);
    }