这是使用javascript进行本地化的最佳方式 [英] which is Best Way For Localization using javascript
本文介绍了这是使用javascript进行本地化的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是使用javascript进行本地化的最佳方式???
它应该是面向对象的东西,我的意思是
i有js文件中的数据如下:
which is Best Way For Localization using javascript???
it should be some thing like object oriented, i mean
i have data in js file like this:
en.userName= Name;
jp.userName= 名前;
fr.userName= nom de
i在html上有标签,如
i have label on html like
<html>
<body>
<label>{fr.userName}:</label>
</body>
</html>
那么它应该自动从javascript文件中获取userName。
可以任何一个给我有什么想法???
thnx提前:)
then it should take userName from javascript file automatically.
can any one give me any idea???
thnx in advance :)
推荐答案
你可以使用jQuery Globalization插件来自Microsoft。请查看: http:// weblogs .asp.net / scottgu / archive / 2010/06/10 / jquery-globalization-plugin-from-microsoft.aspx [ ^ ]
关于Globalization的另一篇好文章。请查看: http://www.hanselman.com/blog/GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx [ ^ ]
我希望这会对你有所帮助。
You could use jQuery Globalization Plugin from Microsoft.Check this out :http://weblogs.asp.net/scottgu/archive/2010/06/10/jquery-globalization-plugin-from-microsoft.aspx[^]
Another good article about Globalization.Check this out :http://www.hanselman.com/blog/GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx[^]
I hope this will help to you.
这篇关于这是使用javascript进行本地化的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文