Merge pull request #7900 from chuckyQ/3.x

Closes #7887: Updated the sphinx.js locale files to improve readability
This commit is contained in:
Takeshi KOMIYA
2020-07-05 11:36:25 +09:00
committed by GitHub

View File

@@ -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