mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-09-27 18:01:30 +02:00
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:
parent
7bc297e99f
commit
663493fd41
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user