py3
This commit is contained in:
18
lib/i18n.py
18
lib/i18n.py
@@ -22,16 +22,24 @@
|
||||
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import gettext, os
|
||||
import gettext, os, six
|
||||
|
||||
LOCALE_DIR = os.path.join(os.path.dirname(__file__), 'locale')
|
||||
language = gettext.translation('electrum', LOCALE_DIR, fallback = True)
|
||||
|
||||
|
||||
def _(x):
|
||||
global language
|
||||
return language.ugettext(x)
|
||||
if six.PY2:
|
||||
def _(x):
|
||||
global language
|
||||
return language.ugettext(x)
|
||||
else:
|
||||
def _(x):
|
||||
global language
|
||||
return language.gettext(x)
|
||||
|
||||
def set_language(x):
|
||||
global language
|
||||
|
||||
Reference in New Issue
Block a user