用其他语言编写JavaScript [英] Write JavaScript in Other Languages

查看:105
本文介绍了用其他语言编写JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些不讲英语的客户.他们希望我为他们编写的JavaScript使用另一种语言.

I have some clients who are not English speaking. They would like the JavaScript I write for them to be in another language.

浏览器可以理解其他语言吗?还是我只能使用非英语的注释?

Can browsers understand other languages, or am I limited to non-English comments?

navigateur.nomApp.indice("Microsoft")

而不是:

navigator.appName.indexOf("Microsoft")

推荐答案

您可以获取任何对象,并将其分配给具有法国名称的变量,例如

You can get any object and assign it to a variable with a French name for instance

var nomAppDeNavigateur = navigator.appName;

然后在任何地方使用它,仅是限于Javascript的关键字. 无论您要使用哪种语言,它仍然必须有意义.

Then use it wherever, it's just the keywords that are restricted to Javascriptish. It still has to make sense though, whatever language you are aiming for.

这篇关于用其他语言编写JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆