From 5969cf5cf9e2f1cc5cc356479397224f6c4a9f1c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 9 May 2013 20:10:54 +0000 Subject: [PATCH] load pandora locale and site locale --- pandora/app/config.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pandora/app/config.py b/pandora/app/config.py index 81790c94f..ae189bb18 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -197,12 +197,14 @@ def update_static(): for f in sorted(glob(os.path.join(settings.STATIC_ROOT, 'json/locale.pandora.*.json'))): with open(f) as fd: locale = json.load(fd) - site_locale = f.replace('pandora', settings.CONFIG['site']['id']) - locale_file = f.replace('.pandora', '') - if os.path.exists(site_locale): - with open(f) as site_locale: - locale.update(json.load(fd)) + site_locale = f.replace('locale.pandora', 'locale.' + settings.CONFIG['site']['id']) + locale_file = f.replace('locale.pandora', 'locale') print 'write', locale_file + print ' adding', f + if os.path.exists(site_locale): + with open(site_locale) as fdl: + print ' adding', site_locale + locale.update(json.load(fdl)) with open(locale_file, 'w') as fd: json.dump(locale, fd) os.system('gzip -9 -c "%s" > "%s.gz"' % (locale_file, locale_file))