开发者

Localization of javascripts and jquery alerts

开发者 https://www.devze.com 2023-02-08 23:44 出处:网络
Is it possible开发者_StackOverflow to localize the javascript and jquery in asp.net (.net 4)? Is there any proper examples with c#?http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalizati

Is it possible开发者_StackOverflow to localize the javascript and jquery in asp.net (.net 4)?

Is there any proper examples with c#?


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


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).

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消