File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -388,16 +388,16 @@ def setup_switchers(
388388 - Cross-link various languages in a language switcher
389389 - Cross-link various versions in a version switcher
390390 """
391- languages_map = dict ( sorted ((l .tag , l .name ) for l in languages if l .in_prod ) )
392- versions_map = { v .name : v .picker_label for v in reversed (versions )}
391+ language_pairs = sorted ((l .tag , l .name ) for l in languages if l .in_prod )
392+ version_pairs = [( v .name , v .picker_label ) for v in reversed (versions )]
393393
394394 switchers_template_file = HERE / "templates" / "switchers.js"
395395 switchers_path = html_root / "_static" / "switchers.js"
396396
397397 template = Template (switchers_template_file .read_text (encoding = "UTF-8" ))
398398 rendered_template = template .safe_substitute (
399- LANGUAGES = json .dumps (languages_map ),
400- VERSIONS = json .dumps (versions_map ),
399+ LANGUAGES = json .dumps (language_pairs ),
400+ VERSIONS = json .dumps (version_pairs ),
401401 )
402402 switchers_path .write_text (rendered_template , encoding = "UTF-8" )
403403
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ const _CURRENT_PREFIX = (() => {
1919 return window . location . pathname . split ( '/' , _NUM_PREFIX_PARTS ) . join ( '/' ) + '/' ;
2020} ) ( ) ;
2121
22- const _ALL_VERSIONS = new Map ( Object . entries ( $VERSIONS ) ) ;
23- const _ALL_LANGUAGES = new Map ( Object . entries ( $LANGUAGES ) ) ;
22+ const _ALL_VERSIONS = new Map ( $VERSIONS ) ;
23+ const _ALL_LANGUAGES = new Map ( $LANGUAGES ) ;
2424
2525/**
2626 * @param {Map<string, string> } versions
You can’t perform that action at this time.
0 commit comments