i18n: Fix loading custom template translations for en (#12220)

Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
This commit is contained in:
Nicolas Peugnet 2024-05-15 07:11:21 +02:00 committed by GitHub
parent 71d50a8658
commit 18d30343f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -271,9 +271,6 @@ class Sphinx:
"""Load translated strings from the configured localedirs if enabled in
the configuration.
"""
if self.config.language == 'en':
self.translator, _ = locale.init([], None)
else:
logger.info(bold(__('loading translations [%s]... ')), self.config.language,
nonl=True)
@ -290,7 +287,7 @@ class Sphinx:
locale_dirs += [path.join(package_dir, 'locale')]
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'))
else:
logger.info(__('not available for built-in messages'))