Skip to content

Commit

Permalink
Put system locale path after the paths specified by configuration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mitya57 committed Nov 9, 2020
1 parent 90f6fd9 commit f92989c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f92989c

Please sign in to comment.