/tortoisehg/hgqt/i18n.py

https://bitbucket.org/tortoisehg/hgtk/ · Python · 20 lines · 10 code · 4 blank · 6 comment · 0 complexity · 857fa27a110d4a194af0e8343f03a832 MD5 · raw file

  1. # i18n.py - internationalization support for TortoiseHg
  2. #
  3. # Copyright 2010 Yuki KODAMA <endflow.net@gmail.com>
  4. #
  5. # This software may be used and distributed according to the terms of the
  6. # GNU General Public License version 2, incorporated herein by reference.
  7. from tortoisehg.util.i18n import _ as _gettext
  8. from tortoisehg.util.i18n import agettext
  9. def _(message):
  10. return unicode(_gettext(message), 'utf-8')
  11. class localgettext(object):
  12. def _(self, message):
  13. return agettext(message)
  14. class keepgettext(object):
  15. def _(self, message):
  16. return {'id': message, 'str': _(message)}