views:

209

answers:

8

I worked on different projects in different countries and remarked that sometimes the code became internationalized, like

SetLargeurEtHauteur()                            (for SetWidthAndHeight, fr)
Dim _ListaDeObiecte as List(Of Object)   (for _ObjectList, ro)
internal void SohranenieUserov()             (for SaveUsers, ru)
etc.

It happens that in countries with Latin alphabet this mix is more pronounced, because there is no need of transliteration.

More than that, often the programming "jargon" is inspired by the project specifications language. There are cases that terms in "project language" have a meaning that is not "translatable" in English.

There are also projects on which works only, say a French team, uses French words (say, Personne, Vehicule, Projet etc).

In that cases I personally add in specifications a "Dictionary" that explains all business object names and only these objects are used in other (French) language.

Say:

Collectif - ensemble des Personnes;

All the actions(Get, Set, Update, Modify, Load, etc) are in English.

Now that "strong" names could be used in code: AddPersonneToCollectif.

  • What is your approach to "internationalization"?

PS.
I was amused that VisualStudio compiles and runs projects in .NET with buttons named à la "btnAddÉlève" or "кпкСтоп"...

+11  A: 

My personal approach, which is shared by many but not all in the programming community, is that source code should be in English and, if possible, all the development tools should be in English too.

The most important reason for this is being able to share your problems and solutions with the world (like we are doing now in StackOverflow, no less) without having to translate class names, error messages, paths and other artifacts every time.

It also helps consistency, because most libraries are written in English and having element names that mix two languages doesn't really help anyone, besides being a constant focus of internal conflicts when a verb like Add isn't always traslated.

English code also makes it easier to add foreign people to a project without worrying about comprehension and misunderstandings (especially between closely related languages, like Spanish and Portuguese, which have lots of false cognates)

A good link on this subject: http://www.codinghorror.com/blog/2009/03/the-ugly-american-programmer.html

(In case anyone wonders, I'm south-american and English is not my primary language)

Diego Mijelshon
About development tools: Sometimes I should force the framework to give me errors in English(if my Visual Studio is in French), because is easier to find a solution in internet.
serhio
100% agree. Source code has to be in english and I hate to read Method Names even in my own language because you never know who wants to read the code afterwards
KroaX
From other part, this is sometimes hard to update an existing project, or to translate everything in English. The programmers with weak English knowledge will find the code hard to read after specifications.
serhio
Actually, it's not hard to create a dictionary of English terms and/or use them in the specs. I've done that in the past.
Diego Mijelshon
@Diego Mijelshon: If specs are in Spanish, how do you will explain the dictionary words, in Spanish or English?
serhio
@serhio, if the specs are in Spanish, they would use the english terms whenever referring to entities, actions, or any other business-specific item that would result in code; the needed translations (when they are not obvious, as would be the case of *user = usuario*) could be in the same place, or in a separate glossary.
Diego Mijelshon
+1  A: 

I think I'd call a code base like that "abysmal" rather than "internationalized", but the general rule I've always heard is that if you ever think that someone other than one who speaks your language might ever touch the code, do it in english.

Daenyth
Even if nobody that the, say French team will work on it, we will have Get *Voila* mixes...
serhio
That is terrible. Pick French or English but *be consistant!*
Daenyth
@Daenyth: you can't be consist<i>e</i>nt with other language that English because of language syntax Get, Set, Then, else
serhio
Fair point. Be consistent with English then ;)
Daenyth
+2  A: 

I have the same issue with Norwegian currently. I guess it depends on your position in the project, the available time and the role of the software.

In my case, I have decided to keep all terms in an existing protocol and library I am working with in Norwegian, as I can reasonably expect that generations of administrative workers have gotten used to these, and since the library depends on the protocol. In a library wrapper for an international project, I have translated each method name literally, and added an English language documentation of the method.

Comments and documentation on the code are in English.

If designing a software from scratch, I would try to find English terms for all method names and even business terms (if reasonable. I can hardly think of an example where no term can be found though.), to keep it "portable".

relet
+3  A: 

Even if everyone on the team is a good English speaker (which is not a given), they may not necessarily know the English equivalent of all the business terminology.

I think it's a project-specific decision what to allow, but I would generally tolerate and in some cases encourage business terms (e.g. entity names) in the local language, but not technical terms (i.e. not Largeur/Hauteur instead of Width/Height).

For example in the financial world in France, everyone knows what is meant by OPCVM and FCP - if you attempt English translations you might end up with more misunderstandings than you do by allowing mixed languages.

Joe
I have the same "problem" with translating "HautLePied" from French for bus drivers.
serhio
IMO, business terms should be encouraged in local terminology when a translation does not exist (like OPVCM in your example.)
Vinko Vrsalovic
+2  A: 

If you're writing code that you may be used internationally one day, write it in English. In doubt, write it in English, even comments if you can (although I suppose you can add a few comments in the language of your workplace).

It's not specific to coding unfortunately. English isn't my native language, but I've been able to read a number of technical papers and participate to international conferences with people from all over the world. These collaborations simply wouldn't work if everyone published in their respective native languages.

It may be sad if you feel like defending your language at all cost, but you have to be realistic about it. I suppose English has the advantage to be relatively simple for achieving a basic level: no genders for names, no conjugations, no cases.

Bruno
More important than being simple to get a basic grasp is the fact that nearly all major automated language translation systems support English.
bta
potentially, any business project may be internationally one day, and I believe we are not tanking here about "hello world" home applications. Even if I'd write a, say, Bugundi national web site, should I write it in English, if I am a Bugundian developer?! :)
serhio
+1  A: 

Generally code referring to language concepts should be in the same mother language as the programming language (i.e. English - for, while, string are all English words).

It's OK (but not great) to have variables and domain concepts in a local language, but you definitely don't want to be translating List, Object, Decimal, etc. into terms which cause programmers more work in reconciling two languages. Even still, I would strongly lobby to restrict very common domain concepts like Collection, Membership, Person, User and possibly less common domain concepts like Invoice, Receipt to English where this is possible.

It would be like coding half your classes in VB and half in C# - your brain has to make a cognitive shift. While this is good for hybrid apps (JavaScript on the web and C# on the backend) because it helps you keep what's running where clear, it isn't good for a general programming.

In addition, using English for everything makes the domain and language words work together better.

There are always exceptions. There are certain cases where you would use a native word anyway - where the word describes the domain best. For instance, in our (English) code base, we had references to Mexican Spanish terms for certain concepts which were only relevant for people running our software in Mexico. Typically, Japanese terms were spelled out phonetically/Romaji, though - it was difficult for non-Japanese to be able to pronounce the pictograms ;-).

Cade Roux
A: 

To keep things consistent, I would make the code the same (human) language as the (programming) language. That is, if the programming language uses English keywords (like for, switch, public, etc) then keep the rest of the code in English. If you are using a compiler that recognizes (say) the Swahili translations of keywords, then keep the rest of the code in Swahili.

Many APIs have standardized naming schemes that are followed regardless of (human) language, and the accompanying documentation is translated as needed (instead of the source code).

No matter what (human) language you choose, pick one and stick with it. I'd much rather try to wade through source code in German than code that was a mix of German and English.

bta
"If you are using a compiler that recognizes the Swahili, then keep the rest of the code in Swahili."And if it recognize the Swahili and Mbuhili, what language should I select? :)
serhio
from the other part, I never seen(only heard) a programming language that uses other than English keywords.
serhio
@serhio- If your compiler/programming language use keywords from multiple languages, I would say pick one and (most importatntly) be consistent. For the best results, pick the more common of the two languages, or the one that has the best available translation tools.
bta
yeah... "consistent", "more common", "best tools"... so, what compiler you know using multiple languages?
serhio
I've seen perl in Latin, python in Mandarin, and C in several languages. I haven't seen a compiler that handles multiple languages, but then again I haven't seen all that many different compilers :) More important is that this is a purely hypothetical example of a general concept. The point of my answer is **keep it consistent**. If all the compilers that you have use English keywords, then there is your answer.
bta
+1  A: 

I think that good design guideline is to write code with use of English names and with english comments only (of course if your team is capable to do this, but in case of international team English seems to be natural choose, since it's a most popular language, expecially in IT world).

Good explanation of such guidline is that keywords in most of programming languages are taken from English so writing your code using English names gives more consistent look and thanks to this you end with code that is easier to read.

Another reason is that most of compilers can handle only ascii characters as names of classes, methods, etc. so probably you will end with some strange names when you decide to use some language with alphabet containing non ascii chars.

Third reason that came to my mind is sharing your code on site like SO. Today I opened a post with a piece of code where classes had Spanish names. It was hard for me to guess what was the purpose of this class (even if sometimes is not necessary it is good when you read code and understand all used words:)).

To sum up I think that internationalization of code is not a good idea. You can imagine that keywords in programming languages (e.g. class, try, while) could also be localized and probably you can imagine also how hard life could be then...

Lukasz Dziedzia