Skip to content

Commit

Permalink
Fix sphinx-doc#6640: i18n: Failed to override system message translation
Browse files Browse the repository at this point in the history
Our document describes that users can override system messages via
their own message catalog named `sphinx.mo` under the locale_dirs.
But it has not been used since its beginning of i18n mechanism because
the priority of users' message catalog is lower than system's.

This makes the priority of users' message catalog higher than system's.
  • Loading branch information
tk0miya committed Aug 14, 2020
1 parent b2d524d commit 4adccf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -17,6 +17,7 @@ Bugs fixed
----------

* #8085: i18n: Add support for having single text domain
* #6640: i18n: Failed to override system message translation
* #8093: The highlight warning has wrong location in some builders (LaTeX,
singlehtml and so on)

Expand Down
2 changes: 1 addition & 1 deletion sphinx/application.py
Expand Up @@ -293,7 +293,7 @@ def _init_i18n(self) -> None:
if catalog.domain == 'sphinx' and catalog.is_outdated():
catalog.write_mo(self.config.language)

locale_dirs = [None, path.join(package_dir, 'locale')] + list(repo.locale_dirs)
locale_dirs = [None] + list(repo.locale_dirs) + [path.join(package_dir, 'locale')]
self.translator, has_translation = locale.init(locale_dirs, self.config.language)
if has_translation or self.config.language == 'en':
# "en" never needs to be translated
Expand Down

0 comments on commit 4adccf7

Please sign in to comment.