diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-11-08 19:29:52 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-11-09 19:32:02 +0300 |
commit | 203094b4c3d0db34527281bd29601ab418325d5c (patch) | |
tree | 1bfadaadd0b53220d3e346ab3c673d09c8671303 /sphinx/util | |
parent | 8e350495b08fe5b06099ff85e3177ebd250e9181 (diff) |
Close #9618: i18n: Add gettext_allow_fuzzy_translations
Diffstat (limited to 'sphinx/util')
-rw-r--r-- | sphinx/util/i18n.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/util/i18n.py b/sphinx/util/i18n.py index e82e33f57..02b42cf0b 100644 --- a/sphinx/util/i18n.py +++ b/sphinx/util/i18n.py @@ -59,7 +59,7 @@ class CatalogInfo(LocaleFileInfoBase): not path.exists(self.mo_path) or path.getmtime(self.mo_path) < path.getmtime(self.po_path)) - def write_mo(self, locale: str) -> None: + def write_mo(self, locale: str, use_fuzzy: bool = False) -> None: with open(self.po_path, encoding=self.charset) as file_po: try: po = read_po(file_po, locale) @@ -69,7 +69,7 @@ class CatalogInfo(LocaleFileInfoBase): with open(self.mo_path, 'wb') as file_mo: try: - write_mo(file_mo, po) + write_mo(file_mo, po, use_fuzzy) except Exception as exc: logger.warning(__('writing error: %s, %s'), self.mo_path, exc) |