diff --git a/.Jules/palette.md b/.Jules/palette.md new file mode 100644 index 0000000..35179af --- /dev/null +++ b/.Jules/palette.md @@ -0,0 +1,3 @@ +## 2025-02-27 - Language Switcher Accessibility and JS Compatibility +**Learning:** Multilingual websites must include `hreflang` and `lang` attributes on language switcher links. Without these, screen readers won't apply the correct pronunciation profiles for the target languages. Furthermore, the `static/js/language-toggle.js` script requires the container to have `id="lang-toggle"` and the links to have a `data-lang` attribute matching the language code (`{{ .Language.Lang }}`) to store and apply user language preferences. +**Action:** When implementing or updating language toggle navigation, always verify that `lang`, `hreflang`, and `data-lang` attributes are present on the links, and the correct container `id` is applied to ensure both robust accessibility and script compatibility. \ No newline at end of file diff --git a/layouts/partials/header/basic.html b/layouts/partials/header/basic.html index fef4c6c..817d7f4 100644 --- a/layouts/partials/header/basic.html +++ b/layouts/partials/header/basic.html @@ -6,6 +6,7 @@ (dict "key" "library" "path" "library") }} +
@@ -24,15 +25,27 @@ {{ i18n "nav_ecosystem" | default "生态" }} - {{ if .IsTranslated }} -