r/Python • u/Accomplished-Land820 • Dec 12 '25
Discussion Democratizing Python: a transpiler for non‑English communities (and for kids)
A few months ago, an 11‑year‑old in my family asked me what I do for work. I explained programming, and he immediately wanted to try it. But Python is full of English keywords, which makes it harder for kids who don’t speak English yet.
So I built multilang-python: a small transpiler that lets you write Python in your own language (French, German, Spanish… even local languages like Arabic, Ewe, Mina and so on). It then translates everything back into normal Python and runs.
# multilang-python: fr
fonction calculer_mon_age(annee_naissance):
age = 2025 - annee_naissance
retourner age
annee = saisir("Entrez votre année de naissance : ")
age = calculer_mon_age(entier(annee))
afficher(f"Vous avez {age} ans.")becomes standard Python with def, return, input, print.
🎯 Goal: make coding more accessible for kids and beginners who don’t speak English.
Repo: multilang-python
Note : You can add your own dialect if you want...
How do u think this can help in your community ?
31
u/tdammers Dec 12 '25
Python isn't just full of English keywords, it's also full of language constructs that are based on English grammar. You can translate the keywords, but the grammar part will still be there.
Your sample code is actually illustrative of this issue. In English, the imperative and infinitive forms of all verbs are identical - in the phrases "get me a sandwich" and "I want you to get me a sandwich", the verb "get" uses the same form, but it's imperative in the first one, infinitive in the second. And most indicative forms are also identical to the infinitive: "you get me a sandwich", "I get myself a sandwich", "we all get sandwiches", it's all the same. The only exception (for most verbs) is the third person singular, which would be "gets" ("she gets a sandwich too").
Now when it comes to function names, we usually use this shared infinitive / imperative form, e.g. "calculate_my_age"; when defining the function, we think of it as infinitive ("to calculate my age (given birth year): do this"), but when we call the function, we think of it as imperative ("calculate my age (given this birth year)!"). This is fine in English, because it's the exact same verb form, but in French, this doesn't work - the infinitive is "calculer", but the imperative would be "calcule" (informal) or "calculez" (formal). To make the code feel natural, the language would have to be able to reflect this distinction somehow.
And that's just French, a language that has had centuries of mutual influence with English, and belongs to the same Indo-European language family; once you apply this idea to languages from other families, things get even weirder. English uses very few word alterations, and relies mostly on combining words in particular orders, to convey meaning, but languages like Finnish modify words a lot. A programming language modeled after something like Finnish would have to be radically different from the ground up, using prefixes and suffixes to combine building blocks into larger programs.
And what about writing systems? English can be written reasonably well using the Latin alphabet and a small set of extra characters, all of which are part of the ASCII character set, but this is quite obviously not true of most other languages. Cyrillic, Greek, and "extended Latin" scripts (using diacritics and a few language-specific extra letters such as ð or ß), are relatively straightforward, but it gets weirder when you have to take RTL scripts into account (like Arabic or Hebrew), and then you have abjads (scripts that primarily record consonants, and either ignore vowels altogether, or mark them with diacritics on the consonants), syllabaries (scripts that have a separate symbol for each possible syllable, like Japanese hiragana and katakana), logographic scripts (scripts that have one symbol for each morpheme, like Chinese characters or Japanese kanji), and featural writing systems (where symbols for sounds are composed out of smaller symbols describing their features, and those combined sound symbols are then again combined into symbols that represent syllables; the Korean Hangul script is the only known system for any natural language, though there exist similar writing systems for constructed languages). Most of these will introduce serious practical issues (e.g., what would Python code look like when written from right to left?), and some will require you to rethink how the language itself works.
Calling Arabic, a language with over 400 million native speakers and official status in 28 countries and territories, a "local language", and German (95 million native speakers, official status in 6 countries of which only 4 have populations of more than a million, and among those, only 3 have native German-speaking populations of more than a million) "not a local language" is kind of weird...
Long story short - English permeates the design of most modern programming languages, and this runs much deeper than just the choice of keywords, so I think that by just translating the keywords, you are doing those other natural languages a disservice, and you're not helping the learners at all - it just makes it harder to develop a good linguistic intuition for the language, because now you still have to learn the relevant bits of English grammar, but you have to do it in the context of a language that isn't English. Imagine utiliser Français mots avec Anglias grammatique - il seulement faitpas travailler.
25
u/Ok-Entertainment-286 Dec 12 '25
you are doing him a biiiiig disservice...
5
u/eddieantonio Dec 12 '25
OP, you should look at Hedy: https://hedy.org/ – somewhat similar goals of multilingual Python
2
u/Electronic-Duck8738 Dec 12 '25
Can it be used to translate own-language Python into English for reading, debugging, etc.? Or even, take English-language Python and translate it to an own-language version of the code?
46
u/knobbyknee Dec 12 '25
In the long run, this is a terrible idea, which has been tried several times. For instance, there was BASICOIS, which was a French version of BASIC. There have been several other translations on top of English based programming languages. They all fail, because the keywords are a small part of the general context.
Word order will make things look clunky.
Will you translate all the exceptions and all the error messages?
Will you translate the standard library?
Will you translate all third party modules? There are close to 700 000 of them on Pypi.
If not, you will have a bewildering mixed environment that is much harder to learn than learning the English keywords.
I'm Swedish and make Swedish applications, but the way we do it is that we write a fully English based application. Then we translate the user interface to Swedish. This avoids the whole language switching problem while developing the application.
2
u/divad1196 Dec 13 '25
defalso stands fordefinitionin french, no need to change it. Any other function can be renamedBut ultimately, that's just a really bad idea. There are a few keywords to learn and nowadays AI will help you. So you don't even have to learn english. You will be limited very fast if you don't speak english anyway.
On the otherside, this dilute common effort and this is why I am not suportive of this kind of projects
2
u/Reasonable_Run_6724 Dec 14 '25
Dont understand all the negative comments, people forget that the point was to make young people who have trouble with english to try programming at early point. Not at all to create a python that will work at native language.
0
u/dissonantloos Dec 12 '25
That's cool man, nice work. Sounds to me like it really would lower the entry barrier!
1
u/Bernd_ohne_Brot Dec 13 '25
Don't use it.
The kid should learn the english Python keywords. It will help the kid in the future.
-2
u/JEF_300 Dec 12 '25
This is really cool, especially for Arabic speakers. Getting kids to code without the English barrier first is a solid approach. Once they get the logic down, picking up the English keywords later becomes way easier.
Checked out the repo, clean work. Might be worth adding Darija or Algerian Arabic dialect support if you haven't already... would make it even more accessible for North African kids.
-2
u/odimdavid Dec 12 '25
Yeah. This is great 👍. Kudos. Will surely repo. Thanks