Write JavaScript in your Local Language
fhtr.org
fhtr.org
Except these macros had been transferred from the Danish version of Word to the Norwegian version. A reasonable percentage of the code had been moved over in ways that made Word treat it as text, instead of tokenized BASIC, and consequently the translation wasnæt made. As a result, they had a ton of Danish keywords in the Norwegian codebase.
Yay. Now, it isn't the worst combination - the two languages are very similar. On the other hand this meant that a lot of things seemed plausible to me in Norwegian, yet still broke horribly because they had sometimes chosen different words that were both valid in either language...
A less hack-y solution might be for new languages to start incorporating more languages in their choices of keywords and class names.
Suppose someone were designing a new language (let's call it Foolang), and these were some of the keywords:
* publico, privado, protegido (access specifiers in Spanish)
* eetha/akhra (if/else in Arabic)
* zhen/jia (true/false in Mandarin)
I think this would be an interesting experiment. It would have to be a compelling language in its own right though.
Still, a language monoculture is more convenient for most programmers. As an English-speaking programmer, I'd hate to have to maintain, say, Chinese code.
Something else that would be useful for him would be a simplified translation dict that only contained jquery functions. Something like http://www.jsrosettastone.com/ but for other spoken languages.
Use case would be quick reference: he sees node.append(...) somewhere but doesn't know what append means so quickly looks it up.
Edit: it's easy to find ways in which something won't work. In the spirit of the recent discussions regarding being positive on HN, let's look for ways things like this can be beneficial.
Writing the entire codebase with localized words hinders collaboration, and code portability.
But having an editor feature that assists with the (human) language would keep all the localization with just a single user rather than in the entire codebase. Additionally, it would be able to display the english version as well, which could help the foreign user learn by osmosis.
Both point at the underlying problem that translation is not a matter of just swapping out the words. For example, the mathematical notation that most programming languages rely upon is fundamentally left to right (much in the same way the keywords are English).
See also http://en.wikipedia.org/wiki/Modern_Arabic_mathematical_nota... (which I just discovered!) and also http://www.w3.org/TR/arabic-math/
"extends": "erweitert",
"abstract": "abstrakt",
"volatile": "volatil",
"interface": "schnittstelle",
"protected": "geschützt",
"transient": "transient",
"implements": "implementiert",
"synchronized": "synchronisiert",You can see them here: http://viewvc.svn.mozilla.org/vc/projects/mozilla.org/trunk/...
Search for "Future Reserved Words"
I am not a native English speaker myself but I've always felt that translations into my language of just about anything (computer lingo, science etc) made difficult concepts harder to understand, not easier.
But why js-i18n? Shouldn't "Localized Javascript" be called js-l10n?
I'll need to extend the compiler to escape reserved words in the target language.
The main difference between the approaches is that BabylScript does things in a more Right Way (they do punctuation, number parsing, localised object property names) whereas js-i18n only maps translated tokens to JavaScript tokens. Token mapping is easy to implement and has no effect on the generated code (though you need to watch out for namespace collisions, as different words in language X may map into one word in language Y). From reading the paper, the BabylScript project needs to do some runtime dispatching to handle translated property names.