Merge pull request #4945 from zhsj/fix-search-lang

fix lang_COUNTRY not fallback correctly for IndexBuilder
This commit is contained in:
Takayuki SHIMIZUKAWA 2018-05-12 16:54:33 +09:00 committed by GitHub
commit a9e66bc447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -105,6 +105,7 @@ Bugs fixed
* i18n: message catalogs were reset on each initialization
* #4850: latex: footnote inside footnote was not rendered
* i18n: fix lang_COUNTRY not fallback correctly for IndexBuilder
Testing
--------

View File

@ -444,9 +444,9 @@ class StandaloneHTMLBuilder(Builder):
# create the search indexer
self.indexer = None
if self.search:
from sphinx.search import IndexBuilder, languages
from sphinx.search import IndexBuilder
lang = self.config.html_search_language or self.config.language
if not lang or lang not in languages:
if not lang:
lang = 'en'
self.indexer = IndexBuilder(self.env, lang,
self.config.html_search_options,