From c73e5b6d9b12bcc04ba0a16ba0c736f6c397a633 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Wed, 25 Aug 2010 06:14:26 +0200 Subject: [PATCH] add locale import to interlocks --- pyfpdb/interlocks.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pyfpdb/interlocks.py b/pyfpdb/interlocks.py index c3794325..3f358019 100755 --- a/pyfpdb/interlocks.py +++ b/pyfpdb/interlocks.py @@ -10,6 +10,18 @@ import time import signal import base64 +import locale +lang=locale.getdefaultlocale()[0][0:2] +if lang=="en": + def _(string): return string +else: + import gettext + try: + trans = gettext.translation("fpdb", localedir="locale", languages=[lang]) + trans.install() + except IOError: + def _(string): return string + InterProcessLock = None """