Localization module is now initialized only once (instead of twice).

This removes an unnecessary initialization and also fixes the behavior
under Windows which was broken because of the second initialization.
This commit is contained in:
Adam Waldenberg 2013-07-04 10:55:54 +02:00
parent 7bc297e99f
commit 663493fd41

View File

@ -24,7 +24,12 @@ import gettext
import locale
import os
__installed__ = False
def init():
global __installed__
if not __installed__:
try:
locale.setlocale(locale.LC_ALL, "")
except locale.Error:
@ -44,4 +49,5 @@ def init():
except IOError:
translation = gettext.NullTranslations()
__installed__ = True
translation.install(True)