2010/11/30 Carl M. Johnson
This has been discussed before. A couple points: - Chinese Python already exists (existed), see http://www.chinesepython.org/cgi_bin/cgb.cgi/english/english.html but it looks like the project has been dead for several years. Why? Because no one really wants a completely localized Python
Well it is clear that professional programmers will master Python syntax in no time, and if someone writes a module, its functions as well as docs better be in English or at least a widely spoken language for the module be used by someone. I'm not trying to put a Chinese Room Argument here ;-) I'm trying to address a very specific case, that is young programmer education. If a young programmer were to, say, name their variables in arabic, why should they be forced to use necessarily awkwards writing direction changes and why should they need to learn a foreign language concept "[... for ... in ... if ...]" or understnad concatenation "elif" or memorize a few hundred standard type methods. My point with young programmers is that they are not learning Python per se, but rather the concept of programming. For example, quite often learning Boolean logic happens during programming classes. Surely it would go better if learner can use native words for "and", "or", "... if ... else ...", etc It would go better if the young mind was not cluttered with unfamiliar conventions and words on top of semantics. Also, the way I see it, the best thing about Python is its libraries. Quite often I just write a statement that uses something from a library I'm not familiar with and it works. Why is that? Because Python libs are designed to be intuitive, however they can only be if the words, method names, etc are already in programmer's head. As far as nobody really wants goes, I think, professional programmers don't need this, sure, But teachers won't even get to think if they want it or not unless it's there.
- The consensus seems to be that while it is a good idea to translate the docstrings/Python docs, there's no point in translating keywords or module names. For one thing, if you ever want to use an outside module, there's going to have be some way of saying that the chrono module = the time module. As a programmer, you can't get away with not knowing that when things go wrong. For another thing, what happens if in english.py I have a variable named "por" and in spanish.py I have a variable named "for"? How can these modules work together?
I think they can, as long as only one language is used within a given module. Python bytecode doesn't store "for" anywhere after all. Module API would need to be adapted of course. Also debugging would be tough. Yet if Python gains thrice as many users at the expense of some bad code out there, it's worth it.
- The comment that tends to come up in these threads is that "non-native English speakers are going to have to learn 'a new language' anyway, so what's the difference between learning to map a word in their own language to a Python concept to learning to map an arbitrary English word to a Python concept. In either case, it doesn't make any sense to write, "for the sake of justice:" in English or "正義のために" in Japanese. Python's "for" is not the English "for." It's its own thing. It means "process this iterator in a loop." That's different from the English "for" and it's going to be different from any existing word in any other language either.
I don't propose to translate python keywords literally, as a matter of fact, for some languages even syntax might change slightly*. Basically some languages might require a different parser and/or "front-end". Actually perhaps the educational part could then be a completely different front-end with much simplified syntax? *) Western world uss 'three fifths" for fractions, while Asia uses "fifths three" in spoken language. Similar differences could pop up with "a and b or c" or "b if a else c" types of expressions. I say it doesn't matter much for core Python as long as same bytecode is generated.
- That said, letting people use unicode variable names is basically a good idea and has already been implemented in Python 3 and can be turned on in Python 2 with the right declarations. Hope that helps, -- Carl Johnson
_______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas