Skip to content

Commit

Permalink
Do not add a language fallback by the stripping country code (sphinx-…
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinhochun authored Jul 11, 2024
1 parent a6c2bdd commit 41ee3be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ Bugs fixed
titles tend to rank higher than subsection titles. In addition, boost matches
on the name of programming domain objects relative to title/subtitle matches.
Patch by James Addison and Will Lachance.
* #9634: Do not add a fallback language by stripping the country code.
Patch by Alvin Wong.

Testing
-------
Expand Down
6 changes: 1 addition & 5 deletions sphinx/locale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,7 @@ def init(
translator = None

if language:
if '_' in language:
# for language having country code (like "de_AT")
languages: list[str] | None = [language, language.split('_')[0]]
else:
languages = [language]
languages: list[str] | None = [language]
else:
languages = None

Expand Down

0 comments on commit 41ee3be

Please sign in to comment.