feat(navbar): language switcher (#760)

* feat(navbar): language switcher

* docs: add language-switch

* chore: just for the demo

* fix: drop conflicting CSS

* fix: use constant

* fix: pre-existing bug with rtl on mobile

* docs: add comment to explain the algo

* chore: more readable algo

* review

Co-authored-by: Xin <5097752+imfing@users.noreply.github.com>

* feat: different icons

* feat: icon as param

* fix: inconsitency with rtl

* fix: render inside the sidebar

* chore: remove the demo

---------

Co-authored-by: Xin <5097752+imfing@users.noreply.github.com>
This commit is contained in:
Ludovic Fernandez
2025-08-18 00:26:43 +02:00
committed by GitHub
parent b2ff662c8e
commit 363b1e50ff
8 changed files with 72 additions and 6 deletions

View File

@@ -69,6 +69,15 @@ There are different types of menu items:
- name: Theme Toggle
params:
type: theme-toggle
label: true # optional, default is false
```
6. Language Switcher
```yaml
- name: Language Switcher
params:
type: language-switch
label: true # optional, default is false
icon: "globe-alt" # optional, default is "translate"
```
These menu items can be sorted by setting the `weight` parameter.