File tree Expand file tree Collapse file tree 4 files changed +21
-13
lines changed
src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components Expand file tree Collapse file tree 4 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 1
1
{# Displays an icon to switch between light mode, dark mode, and auto (use browser's setting). #}
2
2
{# As the theme switcher will only work when JavaScript is enabled, we hide it with `pst-js-only`. #}
3
- < button class ="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only " title ="{{ _('light/dark ') }} " aria-label ="{{ _('light/dark ') }} " data-bs-placement ="bottom " data-bs-toggle ="tooltip ">
4
- < i class ="theme-switch fa-solid fa-sun fa-lg " data-mode ="light "> </ i >
5
- < i class ="theme-switch fa-solid fa-moon fa-lg " data-mode ="dark "> </ i >
6
- < i class ="theme-switch fa-solid fa-circle-half-stroke fa-lg " data-mode ="auto "> </ i >
3
+ < button class ="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only " aria-label ="{{ _('Color mode ') }} " data-bs-title ="{{ _('Color mode ') }} " data-bs-placement ="bottom " data-bs-toggle ="tooltip ">
4
+ < i class ="theme-switch fa-solid fa-sun fa-lg " data-mode ="light " title =" {{ _('Light') }} "> </ i >
5
+ < i class ="theme-switch fa-solid fa-moon fa-lg " data-mode ="dark " title =" {{ _('Dark') }} "> </ i >
6
+ < i class ="theme-switch fa-solid fa-circle-half-stroke fa-lg " data-mode ="auto " title =" {{ _('System Settings') }} " > </ i >
7
7
</ button >
Original file line number Diff line number Diff line change @@ -996,7 +996,15 @@ def test_translations(sphinx_build_factory) -> None:
996
996
assert "Modifier sur GitHub" in str (sidebar_secondary )
997
997
998
998
header = index .select (".bd-header" )[0 ]
999
- assert "clair/sombre" in str (header )
999
+ ## TODO: update once translataion up to date
1000
+ # assert "clair/sombre" in str(header)
1001
+ # Text of theme switcher button have been changed,
1002
+ # "light/dark" has been updated to "Color mode" and does not have a translation yet.
1003
+ if "Color mode" not in str (header ):
1004
+ pytest .xfail (
1005
+ "Please update test_build.py::test_translations now that new translation are available."
1006
+ )
1007
+ # End TODO
1000
1008
1001
1009
footer = index .select (".bd-footer" )[0 ]
1002
1010
assert "Copyright" in str (footer )
Original file line number Diff line number Diff line change 1
- < button aria-label ="light/dark " class ="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only " data-bs-placement ="bottom " data-bs-toggle =" tooltip " title =" light/dark ">
2
- < i class ="theme-switch fa-solid fa-sun fa-lg " data-mode ="light ">
1
+ < button aria-label ="Color mode " class ="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only " data-bs-placement ="bottom " data-bs-title =" Color mode " data-bs-toggle =" tooltip ">
2
+ < i class ="theme-switch fa-solid fa-sun fa-lg " data-mode ="light " title =" Light " >
3
3
</ i >
4
- < i class ="theme-switch fa-solid fa-moon fa-lg " data-mode ="dark ">
4
+ < i class ="theme-switch fa-solid fa-moon fa-lg " data-mode ="dark " title =" Dark " >
5
5
</ i >
6
- < i class ="theme-switch fa-solid fa-circle-half-stroke fa-lg " data-mode ="auto ">
6
+ < i class ="theme-switch fa-solid fa-circle-half-stroke fa-lg " data-mode ="auto " title =" System Settings " >
7
7
</ i >
8
8
</ button >
Original file line number Diff line number Diff line change 33
33
</ div >
34
34
< div class ="sidebar-header-items__end ">
35
35
< div class ="navbar-item ">
36
- < button aria-label ="light/dark " class ="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only " data-bs-placement ="bottom " data-bs-toggle =" tooltip " title =" light/dark ">
37
- < i class ="theme-switch fa-solid fa-sun fa-lg " data-mode ="light ">
36
+ < button aria-label ="Color mode " class ="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only " data-bs-placement ="bottom " data-bs-title =" Color mode " data-bs-toggle =" tooltip ">
37
+ < i class ="theme-switch fa-solid fa-sun fa-lg " data-mode ="light " title =" Light " >
38
38
</ i >
39
- < i class ="theme-switch fa-solid fa-moon fa-lg " data-mode ="dark ">
39
+ < i class ="theme-switch fa-solid fa-moon fa-lg " data-mode ="dark " title =" Dark " >
40
40
</ i >
41
- < i class ="theme-switch fa-solid fa-circle-half-stroke fa-lg " data-mode ="auto ">
41
+ < i class ="theme-switch fa-solid fa-circle-half-stroke fa-lg " data-mode ="auto " title =" System Settings " >
42
42
</ i >
43
43
</ button >
44
44
</ div >
You can’t perform that action at this time.
0 commit comments