From 87ce7aad000a341069cd16e7c4e173330d2fd68e Mon Sep 17 00:00:00 2001 From: tobes Date: Mon, 6 Aug 2012 13:15:15 +0100 Subject: [PATCH] [#2774] I18n more bugfixes --- ckan/lib/cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ckan/lib/cli.py b/ckan/lib/cli.py index 00c9184c9ab..ed2add222bd 100644 --- a/ckan/lib/cli.py +++ b/ckan/lib/cli.py @@ -1550,9 +1550,9 @@ def po2dict(self, po, lang): for occurrence in occurrences: if occurrence[0].endswith('.js'): js_use = True - break + continue if not js_use: - break + continue if entry.msgstr: result[entry.msgid] = [None, entry.msgstr] elif entry.msgstr_plural: @@ -1577,8 +1577,8 @@ def build_js_translations(self): data = self.po2dict(po, l) data = json.dumps(data, sort_keys=True, ensure_ascii=False, indent=2 * ' ') - out_file = open(os.path.join(out_dir, '%s.js' % f), 'w') - out_file.write(data) + out_file = open(os.path.join(out_dir, '%s.js' % l), 'w') + out_file.write(data.encode('utf-8')) out_file.close() print 'Completed generating JavaScript translations'