[Python-ideas] Non-English names in the turtle module.
Stephen J. Turnbull
stephen at xemacs.org
Fri Sep 4 04:34:41 CEST 2015
Chris Angelico writes:
> +1. These modules could simply import a boatload of stuff from
> "turtle" under new names, which would make them fairly slim. Question:
> Should they start with "from turtle import *" so the English names are
> always available? It'd ensure that untranslated names don't get missed
> out, but it might be confusing.
That would be pretty horrible, and contrary to the point of allowing
the new user to learn algorithmic thinking in a small world using
intuitively named commands.
I would think the sensible thing to do is to is invite participation
from traditional translation volunteers with something like
import turtle
from i18n import _
_translations = { 'turtle' : _('turtle'), ... }
for name in dir(turtle):
if name in _translations:
eval("from turtle import {} as {}".format(name, _translations[name]))
elif english_fallbacks_please:
eval("from turtle import {}".format(name))
More information about the Python-ideas
mailing list