PageRenderTime 63ms CodeModel.GetById 56ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 8from tortoisehg.util.i18n import _ as _gettext
 9from tortoisehg.util.i18n import agettext
10
11def _(message):
12    return unicode(_gettext(message), 'utf-8')
13
14class localgettext(object):
15    def _(self, message):
16        return agettext(message)
17
18class keepgettext(object):
19    def _(self, message):
20        return {'id': message, 'str': _(message)}