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 @@ menu:
- name: Theme Toggle
params:
type: theme-toggle
label: true # optional, default is false
```
6. مُبدِّل اللغة
```yaml
- name: مُبدِّل اللغة
params:
type: language-switch
label: true # optional, default is false
icon: "globe-alt" # optional, default is "translate"
```
این آیتم‌های منو را می‌توان با تنظیم پارامتر `weight` مرتب کرد.

View File

@@ -69,6 +69,15 @@ menu:
- name: Theme Toggle
params:
type: theme-toggle
label: true # optional, default is false
```
6. 言語スイッチャー
```yaml
- name: 言語スイッチャー
params:
type: language-switch
label: true # optional, default is false
icon: "globe-alt" # optional, default is "translate"
```
これらのメニュー項目は `weight` パラメータを設定することで並べ替えられます。

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.

View File

@@ -69,6 +69,15 @@ menu:
- name: Theme Toggle
params:
type: theme-toggle
label: true # optional, default is false
```
6. 语言切换器
```yaml
- name: 语言切换器
params:
type: language-switch
label: true # optional, default is false
icon: "globe-alt" # optional, default is "translate"
```
通过设置 `weight` 参数可以调整菜单项的排序。