[docs] Suppress inconsistent references in translated message warning

This commit is contained in:
jack1142 2022-02-20 15:33:05 +01:00 committed by GitHub
parent 4f85494c11
commit 2c72fc9cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import logging
import sys
import os
import re
@ -150,6 +151,21 @@ nitpick_ignore_files = [
"whats_new",
]
# Ignore warnings about inconsistent order and/or count of references in translated messages.
# This makes no sense, different languages can have different word order...
def _i18n_warning_filter(record: logging.LogRecord) -> bool:
return not record.msg.startswith(
(
'inconsistent references in translated message',
'inconsistent term references in translated message',
)
)
_i18n_logger = logging.getLogger('sphinx')
_i18n_logger.addFilter(_i18n_warning_filter)
# -- Options for HTML output ----------------------------------------------
html_experimental_html5_writer = True