Live data from Hacker News

Write JavaScript in your Local Language

fhtr.org

11–20 of 29 posts

Re: Write JavaScript in your Local Language

#13
This should really be an editor feature, something that can automatically replace localized words with english words and later show the localized version when the english version is moused over (or something like that).

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.

Re: Write JavaScript in your Local Language

#14
For what it's worth, you can make the Arabic translation "more native" by adding a "dir=rtl" attribute to the text area, though it's still not quite right. Or you can leave in in LTR mode and put an LRM (in JS, "\u200e") after each word to make it just look like the English with all the words swapped out.

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/

Re: Write JavaScript in your Local Language

#15
post #2

Bad idea. It's bad for collaboration and it looks comic (especially when you need to use words like "HTTP", "POST" near with local language words). We in Russia have already good example of software written in "local language" - "1S". For developers in Russia it's reference of code smell.

Yep. And programming languages, while they use English keywords, are not English. They are languages in their own right, and "translating" words is not a good idea, because that's creating a new language.

I agree this is probably a bad idea, but I still think the basic problem it's trying to solve is a real one.

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.

Re: Write JavaScript in your Local Language

#16
post #15

Earlier quoted context omitted.

Yep. And programming languages, while they use English keywords, are not English. They are languages in their own right, and "translating" words is not a good idea, because that's creating a new language.

I agree this is probably a bad idea, but I still think the basic problem it's trying to solve is a real one. 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/…

I agree that it's a basic problem. There's a language using Japanese keywords out there: http://ja.wikipedia.org/wiki/Mind and a few others: http://en.wikipedia.org/wiki/Non-English-based_programming_l...

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.

Re: Write JavaScript in your Local Language

#17
post #13

This should really be an editor feature, something that can automatically replace localized words with english words and later show the localized version when the english version is moused over (or something like that). 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 j…

Agreed. This would be fabulous as a vim plugin.

Re: Write JavaScript in your Local Language

#18
Always great to see creative work like this :-)

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.

Re: Write JavaScript in your Local Language

#19

Nice work! As a native English speaker I am lucky that the rest of the world works in my language, but it shouldn't have to be that way. But why js-i18n? Shouldn't "Localized Javascript" be called js-l10n?

As a non-native English speaker, yes, it should. Learning a few keywords is nothing compared to the pain that would be sharing that code with others.
Post reply on HN