Please help.

Dave Angel d at davea.name
Mon Feb 9 13:25:40 EST 2015


On 02/09/2015 01:08 PM, John Ladasky wrote:
> On Monday, February 9, 2015 at 9:44:16 AM UTC-8, chim... at gmail.com wrote:
>> Hello. Am trying to change the key words to my tribal language. Eg change English language: print() to igbo language: de(). I have been stuck for months I need a mentor or someone that can guide me and answer some of my questions when I get stuck. Thanks..
>> I will really appreciate it if someone attends to me.
>
>
> In Python, functions are bound to names, exactly like other variables are.  You can bind any new name you want to an existing function, like this:
>
> Python 3.4.0 (default, Apr 11 2014, 13:05:11)
> [GCC 4.8.2] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> print("English")
> English
>>>> de = print
>>>> de("Igbo")
> Igbo
>>>> print("Both function names work")
> Both function names work
>>>> de("Both function names work")
> Both function names work
>
>
> Hope that helps you.
>

That will help him with the functions.  But not with the keywords.  The 
OP didn't specify Python version, but in 3.x, print() is a function, and 
can be rebound.  Since he said keyword, he's either mistaken, or he's 
running 2.x

But any real keywords, are a real problem.  For example, changing 'if' 
to some other string.

And all the library code is a problem, as they have to be individually 
translated.  And many of them are not fully in Python, but have C portions.

Then there's the return strings for exceptions, and file names for imports.

And the documentation, and the inline documentation, and reflection.

Many problems, no good solutions.  It has been considered many times by 
many good Python developers, and no reasonable solution has presented 
itself.

When I use grep at the bash command line, do I want these translated to 
English words.  Nope.  They both are acronyms, but few people know what 
they actually stand for.

I wish there were an answer, but I don't think so, other than using a 
non-language (like Esperanto) to pick all the keywords and library 
functions of a new language in.  Then that new language would be equally 
hard for all nationalities to learn.

http://legacy.python.org/workshops/1997-10/proceedings/loewis.html

http://grokbase.com/t/python/python-list/09bsr7hjwh/python-statements-keyword-localization



-- 
DaveA



More information about the Python-list mailing list