jerrymouse
jerrymouse

Reputation: 17812

Making Python coding locale specific

I figured out:

Does Python support a locale wrapper over its English syntax? Such that all keywords like import, print, etc. are translated into another human language. Consecutively, translating Python code back-and-forth from one human language to another. Reducing English to be just one of several locale-specific human languages. Kids can then write code in their language (given their IDE supports Unicode), which will boil down to same compiled code.

If not, where do I get started to include this feature in Python through an open source project?

Upvotes: 0

Views: 94

Answers (3)

pepr
pepr

Reputation: 20760

If you really want to make it speaking in your native language, think about using something like GvR (The Guido van Robot Programming Language). You can define the actions using your native language. There also was some internationalization effort. For example, it was completely translated into my mother language (including the control commands).

Upvotes: 1

ᅠᅠᅠ
ᅠᅠᅠ

Reputation: 66980

Chinese Python already exists.

A problem with your idea is in libraries – a lot of Python's appeal is in the fact that there's a lot of libraries for it. And virtually all of them use English. Translating all of them is pretty much impossible.

Plus, you don't need much English for Python – it's just individual words like import, and print. They aren't that hard to learn. After all, kids can easily remember words like lumos and wingardium leviosa, which aren't in their native language either.

It's much more important to translate manuals and documentation.

Another bad problem with your idea is that if you teach programmers to write in their native language, the rest of the world won't understand them. As for your question, I think the Chinese Python should have some info on how to translate Python. Look at their repository to see the changes.

Upvotes: 2

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798706

You can use the various modules in the Python language services to parse and compile your DSL.

Upvotes: 0

Related Questions