mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #7887: Updated the sphinx.js locale json dump to indent for readability. Changed files to open with utf8 encoding
This commit is contained in:
parent
61c9aa584c
commit
68abe09afe
6
setup.py
6
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
|
||||
|
Loading…
Reference in New Issue
Block a user