mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
i18n: Fix loading custom template translations for en (#12220)
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
This commit is contained in:
parent
71d50a8658
commit
18d30343f2
@ -271,9 +271,6 @@ class Sphinx:
|
|||||||
"""Load translated strings from the configured localedirs if enabled in
|
"""Load translated strings from the configured localedirs if enabled in
|
||||||
the configuration.
|
the configuration.
|
||||||
"""
|
"""
|
||||||
if self.config.language == 'en':
|
|
||||||
self.translator, _ = locale.init([], None)
|
|
||||||
else:
|
|
||||||
logger.info(bold(__('loading translations [%s]... ')), self.config.language,
|
logger.info(bold(__('loading translations [%s]... ')), self.config.language,
|
||||||
nonl=True)
|
nonl=True)
|
||||||
|
|
||||||
@ -290,7 +287,7 @@ class Sphinx:
|
|||||||
locale_dirs += [path.join(package_dir, 'locale')]
|
locale_dirs += [path.join(package_dir, 'locale')]
|
||||||
|
|
||||||
self.translator, has_translation = locale.init(locale_dirs, self.config.language)
|
self.translator, has_translation = locale.init(locale_dirs, self.config.language)
|
||||||
if has_translation:
|
if has_translation or self.config.language == 'en':
|
||||||
logger.info(__('done'))
|
logger.info(__('done'))
|
||||||
else:
|
else:
|
||||||
logger.info(__('not available for built-in messages'))
|
logger.info(__('not available for built-in messages'))
|
||||||
|
Loading…
Reference in New Issue
Block a user