DEV Community

Cover image for Other languages than English in code

Other languages than English in code

david duymelinck on December 03, 2025

The reason I write English variable, function and object names, is the same reason I'm learning at least a few words in the language that is spoken...
Collapse
 
canro91 profile image
Cesar Aguirre

Story time:

At a past Spanish-speaking job, we wrote all names and warning/error/validation messages in English. The problem came when those messages started to appear in users' screens.

So a pour soul (a junior coder) had the long, tedious, boring task of going all thru the codebase looking for error message to translate them and the QA team to make the app crash to see them...We didn't have AI in those days or a localization module. Arrggg!

Collapse
 
xwero profile image
david duymelinck

The warning and validation messages should be translatable. I live in a country with three official languages, so preparing for multiple language output has become a default.

The error messages should not reach the user, most of the time they contain technical information. They should be intercepted and a user friendly message should be shown.

Just translating the message feels like half the effort to make in right, in my opinion.

Collapse
 
canro91 profile image
Cesar Aguirre

Yes, we did a lot of things wrong at this project :/

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer • Edited

Valid cases for native language are special complicated requirements that can't be explained consisely when there is no English equivalent. Legal and cultures terms, as well as concepts specific to a brand or product. I used to struggle to translate the German "Inbetriebnahmeprozess" which meant a specific set of things to to shortly before and after going live with a new web project. I guess every company or institution develops something similar especially when their processes get more complex and involve a lot of people.

I remember Office macro scripts used to be localized (and hopefully stored as agnostic tokens internally) to match the operating system's natural language. I guess we're lucky that several of those words like THEN have been replaced by abstract symbols like colons, brackets and braces in most modern programming languages.

Still, there are enough built-in English words, some of which with their etymological history dating back to Arabic, Greek, and Latin, so that using any other language for variables, functions and file names feels like breaking consistency unless we do it for a very good reason.

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer

P.S. the 🍌 AI-generated artwork can get boring soon, unless you come up with an unusual creative prompt and a more elaborate description preventing the AI to put a vintage desktop computer at the center of the image.

Collapse
 
xwero profile image
david duymelinck

Yes I'm finding that out now. I agree it is a bad image, but it gave me the opportunity to take a little stab at AI generation.

Thread Thread
 
ingosteinke profile image
Ingo Steinke, web developer

Have a look at the second image in last week's Meme Monday thread. There is a vintage computer, but it's kind of an 1980s laptop in a 1950s café setting. The prompt used in the DEV image generated must have been the first image's alt attribute content. dev.to/ingosteinke/comment/32hei

Collapse
 
sylwia-lask profile image
Sylwia Laskowska

I can share my thoughts on using different languages for variable names. In my projects I use English 100% of the time, because the team is often international - all it takes is one person who doesn’t speak Polish. However, I’ve heard that in government institutions, banks, or projects with very specific and complex domains, developers often use variable names in the local language. The business terminology can be so difficult that coming up with English equivalents would make things even more complicated.

Collapse
 
xwero profile image
david duymelinck

I agree it is not always possible to use your native language in code.

Collapse
 
embernoglow profile image
EmberNoGlow • Edited

In fact, every country has tried (Not always successful) to create their own programming language based on their native language, and in my opinion, they were very inconvenient to use. For example, the biggest problem is the "{} [] : ;" symbols—to type them, you have to constantly change the language on the keyboard! It's incredibly inconvenient. If I were writing in such languages, I'd have to press Shift+Alt a number of times equivalent to lines of code * 2, and that's a lot of useless work.

Collapse
 
xwero profile image
david duymelinck

I wasn't thinking about countries or identity, when I was writing the post. It is more about the best way to communicate with each other in a code language.

I agree that symbols can be a problem, that is one of the reasons I think languages use keywords.
A solution for your problem can be a keyboard with programmable keys. Maybe not for all the symbols, but at least for the ones that you need the most.

Collapse
 
embernoglow profile image
EmberNoGlow

In my opinion, it's better to communicate in English, as it is the most versatile language, even if you have to use a translator 😥.

Thread Thread
 
xwero profile image
david duymelinck • Edited

That is one of the things that could cause problems; using a translator and not knowing if the translation is correct. Even if you are good in English, sometimes you are missing the a subtle meaning that can make the meaning of a name more accurate. Everyone is more aware of the subtleties in their own language.

Most applications don't need to address those subtleties, so I agree English will do in those cases.

Thread Thread
 
embernoglow profile image
EmberNoGlow

Then you can use LLM (unlimited) for translation - this is perhaps one of the most accurate translators today.

Thread Thread
 
xwero profile image
david duymelinck

I assumed you meant an LLM or translation software. Not everyone has easy access to a translator. Sorry for the mistake.

Collapse
 
mythorian_b77f3ebd0bce9c7 profile image
Mythorian

sorry to say this but you all think writing spanish and french and ... is hard while? coding? the try arabic or persias or ... the whole language is right to left!!! do you how fucking hard it is to create a persian app? :( i have to go to hell and back every single time!! and some editors dont even support right to left!!!!!

Collapse
 
master_aless profile image
Jhon Alessandro

Commit yourself to find the bases and principles to deal with those problems, I know it can be hard (I've worked with arabic cases) but once you understand how to tackle those situations, you're settled up to even do something bigger than you think you could do

Don't settle.

Collapse
 
xwero profile image
david duymelinck

I understand where you are coming from. There are languages that read right to left , there are also languages that are read from bottom to top.

I think that it should be possible to have a code language that could accommodate those reading styles, and not only left to right.
The main reason to have a code language is to make logic more easier to communicate.

I find it shocking that editors are not capable to support right to left.

This is one of the comments I was hoping for. Maybe a little less heated, but I understand your passion.

Collapse
 
mythorian_b77f3ebd0bce9c7 profile image
Mythorian

you know now that i think about up to bottom sounds impossible. even more than right to left. im very sorry if my comment was a little heated but it is the frustration of many years of making persian and arabic projects. honestly i wish all the user were english

Collapse
 
fedtti profile image
Federico Moretti

I try to use English everywhere in my code, because Italian has accents, apostrophes, and other diacritical marks that can break parsers and/or compilers.

Using my mother tongue in coding is definitely not a good idea. Not even in prompts: I think Italian requires more tokens than English; LLMs prefer Sumerian, but I only know written Ionic-Attic from high school, and I cannot use it into production! 😅

Collapse
 
xwero profile image
david duymelinck

Most diacritical marks are just another unicode character for the code. And as long as you use the ascii apostrophe a compiler isn't going to bat an eye.

If the language accepts unicode characters, go nuts with Sumerian, old Greek or Sanskrit.
I hope you find a fellow developer to discuss the variable names with.

Collapse
 
art_light profile image
Art light

Wonderful post! I love how clearly you explained the tension between English conventions and native-language clarity—it genuinely made me interested in trying it myself.

Collapse
 
ben profile image
Ben Halpern

PS: The AI generated image always produced a mix of words and just noise, I gave up after ten tries to get a decent result. Maybe AI isn't ready for native language names.

Curious — can you expand on this? Would love to see if there's tweaks that can be made but I'm not sure I follow.

Collapse
 
xwero profile image
david duymelinck

I tried several prompts to try to make the background more realistic, but I all got backgrounds like the one in the current image.
And the other tries I was asking for a class with the class name functions and properties in different languages, not English. And that got me either names with the language in brackets or the rendition you see in the image.

Maybe I didn't prompt the right way, I tried to be as clear as I could be. For the languages I wanted to leave it up to the AI instead of asking for specific languages. But if it can add the names of the languages, it should be able to return words.

Collapse
 
ghavamy profile image
ghavamy

At least you learn a language as it is.😀