From f92989ca6fe4d51f606cfc97610d6e1087b81969 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Mon, 9 Nov 2020 21:27:51 +0300 Subject: [PATCH] Put system locale path after the paths specified by configuration In Debian, we ship the translation data for Sphinx in the default search path, /usr/share/locale/. When a .mo file is present there, it takes priority over the translation files specified by the configuration, so overriding does not work. This makes test_customize_system_message fail. --- sphinx/application.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/application.py b/sphinx/application.py index 59ac04b20cf..9627ac691fb 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -294,8 +294,8 @@ def _init_i18n(self) -> None: if catalog.domain == 'sphinx' and catalog.is_outdated(): catalog.write_mo(self.config.language) - locale_dirs = [None] # type: List[Optional[str]] - locale_dirs += list(repo.locale_dirs) + locale_dirs = list(repo.locale_dirs) # type: List[Optional[str]] + locale_dirs += [None] locale_dirs += [path.join(package_dir, 'locale')] self.translator, has_translation = locale.init(locale_dirs, self.config.language)