import gettext

''' 
gettext module will use the encoding specified in Content-Type header for 
Gnu mo files, and convert the message strings to unicode. Here you could 
sepcify the *output* encoding to others.
'''
gettext.bind_textdomain_codeset('gedit', codeset='UTF-8')

''' 
gettext module will try to retrieve messages from /usr/share/locale by 
default, otherwise you need to explicitly set it. 
'''
gettext.bindtextdomain ('gedit', '/usr/share/locale')

_ = lambda msg: gettext.dgettext ('gedit', msg)
N_ = lambda msg: msg

print _("Save")
评论:

发表一条评论:
该日志评论功能被禁用了。

This blog copyright 2009 by yongsun