Skip to content Skip to sidebar Skip to footer

Write Javascript In Other Languages

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 limite

Solution 1:

JavaScript isn't written in English, it's written in JavaScript.

Solution 2:

JavaScript's keywords are in English and browsers' object names are in English. You can't get around this. Even if all of your variable and function names are in French, you'll still need to have English keywords lying around. Your clients will have to live with this.

Solution 3:

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

var nomAppDeNavigateur = navigator.appName;

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.

Solution 4:

JavaScript is a dynamic language that responds well to monkey-patching:

String.prototype.indice= String.prototype.indexOf;navigator.nomApp= navigator.appName;window.navigatrice= navigator;

Et voilĂ ! Your code fragment works as-is. Well, except for the curious way your browser is masculine.

PS. Don't do this.

Solution 5:

I highly suggest you do not do this. I also think this is not possible. Not only are you throwing away tons of documentation which uses only english but you are making it very difficult for non-french speaking people to code with your application.

See Jeff Atwoods post about this here:

The Ugly American Programmer

Post a Comment for "Write Javascript In Other Languages"