[Python-Dev] Fwd: i18n
Guido van Rossum
guido at python.org
Wed Aug 25 20:26:05 CEST 2010
On Wed, Aug 25, 2010 at 10:59 AM, Alcino Dall'Igna Jr <adijbr at gmail.com> wrote:
> To those beginners in programming that are not English speakers there
> are 3 problems to be solved:
> 1) the logic (this is unavoidable)
> 2) the programming language (hard but quite simple)
> 3) the messages (hard and not simple)
> Those who could not cope with (1) could not be programmers
> (2) difficult but not the main (so a 2nd step)
> (3) the worst but more treatable and more largely useful
> The i18n of (2) is mainly to be used in initial stages and could not
> be generally applicable (maybe just some European languages). This
> probably could require to rewrote the scanner (or maybe only the
> grammar, I haven't gone so deep yet) so it's not that big of a
> problem, it hardly affects the parser and interpreter, that are the
> more complex tasks.
IMO (2) is a bad idea. You'd have to translate not just the keywords
but also the builtins and the standard library. Or else your users
would still live in a mixed-world and the benefit would be minimal.
But translating the stdlib is too much work. (It can't be fully
automated, due to things like getattr(x, 'foo').) There's also the
danger that users would write code in their local dialect and expect
to share it with others in another locale. Let them read and write
broken English, it's unavoidable anyway! (Probably they know more
broken English than you think. After all they are using computers
> If (3) could enter the main trunk it would be a great help by itself.
> In this case access to international help is useless due the original
> difficulties with the language, remember I'm talking about kids
> mainly, and 1st stage to programming for youngsters. There are two
> main ways to do this, one is using codes as indicated, but I prefer
> using the more generally accepted and used, with messages catalogs
> using gettext and the like.
That sounds painful, but in general I am okay with the idea of
translating messages. I think the system messages (those that go with
IOError and OSError) may already be translated. How to do it without
off-putting the core developers may end up being a research problem.
--Guido van Rossum (python.org/~guido)
More information about the Python-Dev