Skip invalid translate files

This commit is contained in:
shortcutme 2018-07-06 22:56:54 +02:00
parent 8bdc61ddcc
commit dc2051fb59
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -35,8 +35,12 @@ class Translate(dict):
def load(self):
if os.path.isfile(self.lang_file):
try:
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)
else:
data = {}