简体   繁体   English

javascripts和jquery警报的本地化

[英]Localization of javascripts and jquery alerts

Is it possible to localize the javascript and jquery in asp.net (.net 4)? 是否可以在asp.net(.net 4)中本地化javascript和jquery?

Is there any proper examples with c#? c#有没有合适的例子?

http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalization-plugin-from-microsoft.aspx http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalization-plugin-from-microsoft.aspx

This site provides a demo application of globalization of jquery in .net 该站点在.net中提供了jquery全球化的演示应用程序

I usually create one localization script per language for a plugin. 我通常为插件为每种语言创建一个本地化脚本。 The script contains variables with all strings that the plugin use. 该脚本包含插件使用的所有字符串的变量。 Other scripts let you define all text strings in the plugin options. 其他脚本允许您在插件选项中定义所有文本字符串。

I then use ASP.NET to define which language (since the user might not want the language reported by the browser). 然后我使用ASP.NET来定义哪种语言(因为用户可能不想要浏览器报告的语言)。

In your master page: 在您的母版页中:

<script type="text/javascript" src="/Scripts/jquery.yourplugin.resources.<%= userLanguage %>.js"></script>
<script type="text/javascript" src="/Scripts/jquery.yourplugin.js"></script>

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

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