Skip invalid translate files
This commit is contained in:
parent
8bdc61ddcc
commit
dc2051fb59
1 changed files with 6 additions and 2 deletions
|
@ -35,8 +35,12 @@ class Translate(dict):
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
if os.path.isfile(self.lang_file):
|
if os.path.isfile(self.lang_file):
|
||||||
data = json.load(open(self.lang_file))
|
try:
|
||||||
logging.debug("Loaded translate file: %s (%s entries)" % (self.lang_file, len(data)))
|
data = json.load(open(self.lang_file))
|
||||||
|
logging.debug("Loaded translate file: %s (%s entries)" % (self.lang_file, len(data)))
|
||||||
|
except Exception as err:
|
||||||
|
logging.error("Error loading translate file %s: %s" % (self.lang_file, err))
|
||||||
|
data = {}
|
||||||
dict.__init__(self, data)
|
dict.__init__(self, data)
|
||||||
else:
|
else:
|
||||||
data = {}
|
data = {}
|
||||||
|
|
Loading…
Reference in a new issue