12

I realize most languages support multiple languages, but every language I've seen has always been more-or-less US-centric. By that, I mean the keywords, standard library functions, etc. all have english names. So, as a programmer, you still really need to know at least some english to make sense of it.

Are there any truly "multi-lingual" languages out there with support for language keywords and such in multiple languages?

2

11 Answers 11

30

This is generally a horrible idea, as anyone who's worked in a localized IDE can attest to. Programmers rely heavily on having one common vocabulary. When the compiler gives me the error "missing type specifier - int assumed", I can share this exact error message with others, for example here on SO, and it will be familiar to those others so they can tell me what it means. If the compiler instead generated error messages in Danish, I'd be limited to getting help from the relatively few programmers who speak Danish.

Suddenly my vocabulary is no longer the same as someone in the same position in Germany, France or Japan. We can no longer exchange code, bugs, bug fixes or ideas.

A developer in Spain wouldn't be able to use my code because it was literally written in another language. And if I had trouble with my code, others would be helpless to debug it, because it wouldn't even compile under their localization settings (and if it did, it'd still be unreadable to them).

Ultimately, a programming language is a language. It may have borrowed some words from English, but it is not English, and you do not need to understand English to program in it, any more than I need to understand latin in order to speak English (English borrows latin words as well).

You might as well ask for a multi-lingual English. What would be the point? Yes, it would in theory allow people who didn't speak English to... speak English. It just wouldn't be the same English as every other English-speaker speaks, so it wouldn't actually enable communication between them.

The keyword if in a programming language is not the same as if in the English language. They mean different things, even though one was obviously inspired by the other.

The delegate keyword in C# does not mean the same thing as "delegate" in English. Nor does while, return or "constructor". They are not english words, they are keywords or concepts in C++, Java, C#, Python or any other programming language.

1
  • 19
    Exactly, when PHP says "Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM", we all know exactly what's gone wrong.
    – Chad Birch
    Mar 20, 2009 at 20:40
9

Sounds like a bad idea to me. If I'm writing a program, how am I to know that the variable name I'm typing is actually a keyword in Bulgarian or Korean as transliterated? Do I have to deal with thousands of keywords, or do I have problems combining two routines written by my Swedish and Egyptian colleagues?

Just realize that programming keywords are in English, just like music keywords are in Italian.

2
  • I see your point, but the keyword issue at least could be overcome by specifying the code language at compile time or in the code file itself. Libraries could also be dealt with by providing "localized" names for functions - i.e. the same function could have multiple names depending on the locale. Mar 20, 2009 at 20:16
  • Which gives a new meaning to Hungarian notation, I suppose. It means I can't read any printed software in Hungarian. It means I can't get a program from a German and use simple tools. It complicates library implementation considerably. Mar 23, 2009 at 13:57
4

This seems like a good place to start: Non-English-based programming languages.

There's a few interesting ones on there, like Python translated to Chinese.

2

You can make use of the C/C++ preprocessor to redefine all the keywords - and some people have done this. I came across it when working as a trainer/mentor for a Norwegian company. Some bright spark had implemented aheader that translated all the C keywords into Norwegian and enforced its use. The Norwegian staff, all of whom spoke excellent English (or I couldn't have earned my crust with them) all hated it and it died a death.

I've also worked fairly extensively in the Netherlands, and most of the programmers there seem to program in English. The only people I've come across who are resistant to the English hegemony in programming languages are (needless to say) the French.

2

There is one area where a localized language may be useful and helpful and these are DLSs (Domain Specific Languages) that were designed to be used by non-programmers. Those languages can surely benefit from being localized since business users from non-English speaking countries often don't know English as well as programmers do.

Such localized DSLs can prove advantageous to programmers as well if they deal with a lot of non-translatable terms. One rather successful system I've encountered was used to calculate salaries for personnel in the Israeli military. It used a Hebrew-based syntax together with hundreds of terms that can only be properly expressed in Hebrew. In that particular case the standard logic keywords if, then, else, etc. were translated to Hebrew and the entire code editor was right-to-left. A very large body of business logic is maintained in this manner to this day and, IMHO, rightly so.

2

It seems like it would be notoriously difficult, unless it was a community effort, but for some languages I don't see why you can't make an existing language multi-lingual, but creating custom libraries that localize standard libraries.

For example, in Java, you can create

public class HoweverYouSayExampleObjectInYourLanguage extends ExampleObjectName {
  }

and then create wrapper functions / methods with names in your target language, but which basically call existing standard methods

private void HoweverYouSayExampleMethodInYourLanguage(parameters) {
      this.ExampleMethod(parameters);
      // Some error handling code
}

If you do error handling properly, the stack trace / errors will all reference errors in the standard libraries, unless it was an error speficially with the implementation of your localization library - in which case that should be pointed out via proper error handling in the localization library itself.

The disadvantage would be, as other people have mentioned, sharing source code. If we were all on the same page with an IDE for a given language - I don't see a reason why you couldn't build a really internationalized IDE in which the source code you see on the screen isn't the REAL source code per se, but a local rendering of the real source code via some form of mapping.

I'm going to go ahead and say that everything I just said above is probably at best an okay idea because function names aren't nearly as important as localized documentation for libraries and APIs. something which in my experience is done terribly or not at all for common programming languages / contexts.

0

You can program Perl in Latin.

0

Don't try to code in the natural language, that's useless. Learn the "programming" language instead.

For instance, the "switch" word didn't mean anything to me in English, but it was an instruction to decide over several choices.

Later ( when I learn english ) I thought.. Hey, this is funny, English do have a "switch" word too, just like C. ( doh! )

:)

No matter how good or bad your English is, you can't say to java

import java.util.* into my CD-ROM;

Because it is not a valid syntax.

0

What about languages like APL and J? The keywords in APL are all single symbols; unfortunately, most of these are not on your keyboard, so J came along and replaced most of them with ASCII representations (made up of more than one character in many cases).

0

Sorted!

Sorted! is bilingual. It can understand both english and german code. To my knowledge, Sorted! is the only programming language that can do this, in the world.

Any useful ones? That's a better question.

0

To a significant extent, you can program in prolog in any unicode script (because it is a symbolic language). There's a (tiny, weeny) catch - variables are signified by an initial capital Roman letter in all the prolog compilers you are likely to come across and you'll have to redefine the built-ins (but prolog makes this relatively easy*).

I think an example will illustrate what I mean best:

% an algorithm for finding easter dates, given year (as first argument)

復活節( V1, V2, V3) :-
   A 是 (V1 mod 19),
   B 是 V1// 100,
   C 是 V1 mod 100,
   D 是 B // 4,
   E 是 B mod  4,
   F 是 (B + 8) // 25,
   G 是 (B - F + 1) // 3,
   H 是 (19*A + B - D - G + 15 )mod 30,
   I 是 C // 4,
   J 是 C mod  4,
   K 是 (32 + 2*E + 2*I - H - J) mod  7 ,
   L 是 (A + 11*H + 22*K) // 451,
   M 是 (H + K - 7*L + 114) // 31,
   N 是 (H + K - 7*L + 114)mod  31,
   V2 是 M,
   V3 是 N + 1.

/*

Example test:

?- 復活節( 2013, V2 , V3). V2 = 3 , V3 = 31

i.e. Easter this year will be on 31st March

*/

  • this is what I used to redefine the build in 'is' operator (don't shoot me if it's imperfect):

    :-op(500,xfy,是).

    是(X,Y):-is(X,Y).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.