Yes, it*s time to learn regular expressions.

advertisement
TORTUGA.PY
EXPANDING TURTLE.PY
BEYOND ENGLISH
@AlSweigart
[email protected]
(last name rhymes with “why dirt”)
bit.ly/tortugapy
>>> import turtle
$ python –m turtledemo
£
and
as
assert
break
class
continue
def
del
elif
else
except
False
finally
for
from
global
if
import
in
is
lambda
None
nonlocal
not
or
pass
raise
return
True
try
while
with
yield
en
als
beweren
breken
klasse
voortzetten
bepalen
verwijderen
alsanders
anders
behalve
vals
tenslotte
voor
van
globaal
als
importeren
in
is
lambda
geen
nietlokale
niet
of
slagenvoor
verhogen
terugkeer
waar
proberen
terwijl
met
opbrengst
Internationalization
Internationalization
I18N
>>> import tortuga
pip install tortuga
github.com/asweigart/tortuga
End Goal: Add to turtle & turtledemo
•
•
•
•
Based on turtle.py
Non-English string table (a dictionary)
Add aliases for the function names
4k per language
>>> import turtle
>>> turtle.tortuga()
Source Code Excerpt
_SPANISH_IDENTIFIERS = {
'TurtleScreen': 'PantallaTortuga',
'RawTurtle':
'TortugaBruta',
'RawPen':
'LapizBruto',
...
# Add Spanish names for all Turtle methods
for englishName in _tg_turtle_functions:
if englishName in _SPANISH_IDENTIFIERS and
englishName in locals():
locals()[_SPANISH_IDENTIFIERS[englishName]] =
locals()[englishName]
Tú
Vous
You
posicion()?
¿posición()?
TODO
•
•
•
•
•
•
translations, verification of translations
expand unit tests
“simple english” tutorial
translate tutorial
promote in non-english schools/websites
code review & commit to python
- open source projects
- tutorials
- documentation
- I18N, _()
- idioms
You
TORTUGA.PY
EXPANDING TURTLE.PY
BEYOND ENGLISH
@AlSweigart
[email protected]
(last name rhymes with “why dirt”)
bit.ly/tortugapy
Related documents
Download