开发者

Localization and JQuery/JavaScript

开发者 https://www.devze.com 2022-12-31 09:16 出处:网络
I\'m working on different language packs for my web app. Some of the output is generated by the JavaScript/JQuery and I can\'t use .aspx.resx resource files within the JavaScript. What options do I ha

I'm working on different language packs for my web app. Some of the output is generated by the JavaScript/JQuery and I can't use .aspx.resx resource files within the JavaScript. What options do I have in order to localize output produced by the client?

开发者_JS百科

Thanky you


The most common way I've seen is different .js language files being kept in a lang/ or locale/ folder in the project, with only the file for the current language being included using a <script> tag.

If you want to manage your languages in one, central, server-side place, I think you would indeed be best of outputting your translations from ASP as a JavaScript file. I don't know ASP but that should be perfectly possible to do - just remember to send a Content-type: text/javascript header along.

Related, PHP oriented but doesn't really matter: this question. Check out the translation plugins mentioned there, they may save you work additionally.

0

精彩评论

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