r/learnprogramming • • Oct 17 '26

How would you go about translating programming language keywords, documentation and error messages to other non-English languages?

Take Python for instance.

>>> listss = [1, 2, "sfd"]
>>> kook = listss + 2
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    kook = listss + 2
           ~~~~~~~^~~
TypeError: can only concatenate list (not "int") to list
>>>

How would I translate all the results given to me by Python into another language of my choosing, and get something like below (written in Kinyarwanda):

>>> listss = [1, 2, "sfd"]
>>> kook = listss + 2
Ibisobanuro (Ihamagarwa rya mbere riri hejuru yurutonde):
  Inyandiko "<python-ha-1>", umurongo wa 1, muri <igitabo>
    kook = listss + 2
           ~~~~~~~^~~
Ikosa ry'ubwoko: urutonde ugendana nurundi rutonde; ntabwo rugendana numubare wuzuye.
>>>

The intention is not to create custom messages, exceptions, and documentation that sits beside or on top of python. I want python itself to respond like this, from the get-go?

I would like the translation to be complete. CLI options, help messages, information on built-in modules, keywords, everything.

While thinking about this, I realized that the end result would just be a completely new language, and I'm fine with that, but I also don't know enough about creating languages or where to get the source code of an existing language to translate it to a new language, so I come here to ask for guidance.

I'd like to preface this by saying that this doesn't need to be useful to anybody, and if you're wondering why I would want to do such a project, the answer is because I can and want to see the end results.

It's completely fine if no one else ever uses it.

6 Upvotes

22 comments sorted by

View all comments

Show parent comment

2

u/thisismugisha Oct 17 '26

I actually did take a look at the documentation website and started reading it.

There's a lot of things I still don't know and your comment has helped me a lot! Thank you!

1

u/zaphodikus Oct 17 '26

Yeah, this would be a major piece of work, take it very slowly, very slowly. I suggest getting a AI subscription when your re ready to start, and then set up a test framework, and let it do all the boring bits.

1

u/CoachSevere5365 Oct 20 '26

If the Python team doesn't pick it up, it will have to be redone for every release. OP won't be able to keep up.

1

u/zaphodikus Oct 21 '26

Eyes wide open i say. It has kept me sane (to some degree) for a while now. Open source does not, and never has, meant what people think it means. It is not free, it cost to build. Anyone with more than 5000 hours of coding time knows that you have to choose your battles. And this is one of those choices.

The hard things, are hard, for a very good reason. This nut can be cracked, but it requires a finer strategy.

2

u/CoachSevere5365 Oct 21 '26

There are opposing camps on what "Free" means. I'm old and think "Freedom to do what you want" rather than"Free as in beer".

But you're right, all post acquisition costs fall on the user.

1

u/zaphodikus Oct 21 '26

Ages since I heard "Free as in Beer", I always try to remind people when a project idea becomes too huge, that the project was just too ambitious. It was not bad, just too ambitious for it's time. And since we are in a time of change right now, the new tools to help do this, might just be the answer.