Skip to content

Commit acf579e

Browse files
committed
[FIX] core: list versions in descending order in the version switcher
closes #12372 X-original-commit: 3442288 Signed-off-by: Antoine Vandevenne (anv) <[email protected]>
1 parent 124d554 commit acf579e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: conf.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@
227227
sphinx.util.i18n.docname_to_domain
228228
) = lambda docname, compact: docname.split('/')[1 if docname.startswith('applications/') else 0]
229229

230-
# The version names that should be shown in the version switcher, if the config option `versions`
231-
# is populated.
230+
# The labels used in the version switcher to show the versions provided with the `versions` config
231+
# option. If a provided version has no label, the version string is used as label.
232232
versions_names = {
233233
'master': "Master",
234234
'saas-18.2': "Odoo 18.2",
@@ -239,8 +239,8 @@
239239
'16.0': "Odoo 16",
240240
}
241241

242-
# The language names that should be shown in the language switcher, if the config option `languages`
243-
# is populated.
242+
# The labels used in the language switcher to show the languages provided with the `languages`
243+
# config option. If a provided language code has no label, the upper-cased code is used as label.
244244
languages_names = {
245245
'de': 'DE',
246246
'en': 'EN',
@@ -458,7 +458,7 @@ def versionize():
458458

459459
# Map alternate versions to their display names and URLs.
460460
context['alternate_versions'] = []
461-
for alternate_version_ in provided_versions_:
461+
for alternate_version_ in reversed(provided_versions_): # Reverse to show latest first.
462462
if alternate_version_ != version:
463463
display_name_ = versions_names.get(alternate_version_, alternate_version_)
464464
context['alternate_versions'].append((display_name_, build_url(alternate_version_)))

0 commit comments

Comments
 (0)