File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1+ #encoding=utf-8
12'''http://ginstrom.com/scribbles/2007/10/08/design-patterns-python-style/'''
23
34class GreekGetter :
45 """A simple localizer a la gettext"""
56 def __init__ (self ):
6- self .trans = dict (dog = "σκύλος" , cat = "γάτα" )
7+ self .trans = dict ( dog = "σκύλος" , cat = "γάτα" )
78
89 def get (self , msgid ):
910 """We'll punt if we don't have a translation"""
1011 try :
11- return str ( self .trans [msgid ])
12+ return self .trans [msgid ]
1213 except KeyError :
1314 return str (msgid )
1415
@@ -26,4 +27,4 @@ def get_localizer(language="English"):
2627e , j = get_localizer ("English" ), get_localizer ("Greek" )
2728# Localize some text
2829for msgid in "dog parrot cat bear" .split ():
29- print ( e .get (msgid ), j .get (msgid ) )
30+ print e .get (msgid ), j .get (msgid )
You can’t perform that action at this time.
0 commit comments