summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorCharles <charles.quinn@comcast.net>2020-06-30 14:44:34 -0400
committerCharles <charles.quinn@comcast.net>2020-07-04 15:34:36 -0400
commit68abe09afe9f33a3ce0ea4e909a78377b2069ddf (patch)
tree03e550cc2534140a66349f8db1934c7c782ef8fd /setup.py
parent61c9aa584c8d7c4b60f32465dd4e4bff64e1e09c (diff)
downloadsphinx-git-68abe09afe9f33a3ce0ea4e909a78377b2069ddf.tar.gz
Closes #7887: Updated the sphinx.js locale json dump to indent for readability. Changed files to open with utf8 encoding
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 3d499983f..a404f1fa5 100644
--- a/setup.py
+++ b/setup.py
@@ -139,7 +139,7 @@ else:
domain + '.js'))
for js_file, (locale, po_file) in zip(js_files, po_files):
- with open(po_file) as infile:
+ with open(po_file, encoding='utf8') as infile:
catalog = read_po(infile, locale)
if catalog.fuzzy and not self.use_fuzzy:
@@ -157,13 +157,13 @@ else:
msgid = msgid[0]
jscatalog[msgid] = message.string
- with open(js_file, 'wt') as outfile:
+ with open(js_file, 'wt', encoding='utf8') as outfile:
outfile.write('Documentation.addTranslations(')
dump({
'messages': jscatalog,
'plural_expr': catalog.plural_expr,
'locale': str(catalog.locale)
- }, outfile, sort_keys=True)
+ }, outfile, sort_keys=True, indent=4)
outfile.write(');')
cmdclass['compile_catalog'] = compile_catalog_plusjs