better error if we have invalid locale files

This commit is contained in:
j 2023-08-04 17:13:56 +02:00
parent a8d906743a
commit 56f248894e

View file

@ -327,7 +327,11 @@ def update_static():
#locale #locale
for f in sorted(glob(os.path.join(settings.STATIC_ROOT, 'json/locale.pandora.*.json'))): for f in sorted(glob(os.path.join(settings.STATIC_ROOT, 'json/locale.pandora.*.json'))):
with open(f) as fd: with open(f) as fd:
try:
locale = json.load(fd) locale = json.load(fd)
except:
print("failed to parse %s" % f)
raise
site_locale = f.replace('locale.pandora', 'locale.' + settings.CONFIG['site']['id']) site_locale = f.replace('locale.pandora', 'locale.' + settings.CONFIG['site']['id'])
locale_file = f.replace('locale.pandora', 'locale') locale_file = f.replace('locale.pandora', 'locale')
print('write', locale_file) print('write', locale_file)