Skip to content

Commit 41ee3be

Browse files
authored
Do not add a language fallback by the stripping country code (#9635)
1 parent a6c2bdd commit 41ee3be

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ Bugs fixed
119119
titles tend to rank higher than subsection titles. In addition, boost matches
120120
on the name of programming domain objects relative to title/subtitle matches.
121121
Patch by James Addison and Will Lachance.
122+
* #9634: Do not add a fallback language by stripping the country code.
123+
Patch by Alvin Wong.
122124

123125
Testing
124126
-------

sphinx/locale/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,7 @@ def init(
114114
translator = None
115115

116116
if language:
117-
if '_' in language:
118-
# for language having country code (like "de_AT")
119-
languages: list[str] | None = [language, language.split('_')[0]]
120-
else:
121-
languages = [language]
117+
languages: list[str] | None = [language]
122118
else:
123119
languages = None
124120

0 commit comments

Comments
 (0)