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.
This commit is contained in:
Dmitry Shachnev
2020-11-09 21:27:51 +03:00
parent 90f6fd90e0
commit f92989ca6f

View File

@@ -294,8 +294,8 @@ class Sphinx:
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)