File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -869,22 +869,23 @@ def _check_python_version():
869
869
870
870
return ret
871
871
872
+ # gettext
873
+ locale .setlocale (locale .LC_ALL , '' ) # use user's preferred locale
874
+ language , encoding = locale .getlocale ()
875
+ if language is not None :
876
+ filename = "language_%s.mo" % language [0 :2 ]
877
+ try :
878
+ trans = gettext .GNUTranslations (open (filename , "rb" ))
879
+ except IOError :
880
+ trans = gettext .NullTranslations ()
881
+ trans .install ()
882
+ _ = trans .gettext
883
+ else :
884
+ _ = MultiLanguage .get_string
872
885
873
886
if __name__ == "__main__" :
874
887
DataStatistic .stat_event ('cocos' , 'start' , 'invoked' )
875
888
876
- # gettext
877
- locale .setlocale (locale .LC_ALL , '' ) # use user's preferred locale
878
- language , encoding = locale .getlocale ()
879
- if language is not None :
880
- filename = "language_%s.mo" % language [0 :2 ]
881
- try :
882
- trans = gettext .GNUTranslations (open (filename , "rb" ))
883
- except IOError :
884
- trans = gettext .NullTranslations ()
885
- trans .install ()
886
- _ = trans .gettext
887
-
888
889
# Parse the arguments, specify the language
889
890
language_arg = '--ol'
890
891
if language_arg in sys .argv :
You can’t perform that action at this time.
0 commit comments