✨ feat(i18n): display lcode in language switcher (#565)
This commit is contained in:
@@ -200,6 +200,8 @@ fediverse_creator = { handle = "zloy_linux", domain = "zlinux.ru" }
|
|||||||
show_previous_next_article_links = true
|
show_previous_next_article_links = true
|
||||||
invert_previous_next_article_links = true
|
invert_previous_next_article_links = true
|
||||||
|
|
||||||
|
# For multilingual sites: show current language code on the language switcher.
|
||||||
|
show_selected_language_code_in_language_switcher = false
|
||||||
|
|
||||||
# Enable iine like buttons on all posts: https://iine.to/
|
# Enable iine like buttons on all posts: https://iine.to/
|
||||||
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
|
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
|
||||||
|
|||||||
@@ -126,6 +126,28 @@ header {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.language-switcher-icon-with-code {
|
||||||
|
margin-inline-end: 0.3rem;
|
||||||
|
width: 0.7rem;
|
||||||
|
height: 0.7rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.language-switcher-icon-code {
|
||||||
|
position: absolute;
|
||||||
|
top: -0.15rem;
|
||||||
|
z-index: 10;
|
||||||
|
inset-inline-start: 0.7rem;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
color: var(--text-color);
|
||||||
|
font-size: 0.5rem;
|
||||||
|
text-transform: uppercase;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--meta-color);
|
||||||
|
}
|
||||||
|
|
||||||
.dropdown {
|
.dropdown {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
<li class="language-switcher">
|
<li class="language-switcher">
|
||||||
<details class="dropdown">
|
<details class="dropdown">
|
||||||
<summary role="button" aria-haspopup="true" title="{{ macros_translate::translate(key="language_selection", default="Language selection", language_strings=language_strings) }}" aria-label="{{ macros_translate::translate(key="language_selection", default="Language selection", language_strings=language_strings) }}">
|
<summary role="button" aria-haspopup="true" title="{{ macros_translate::translate(key="language_selection", default="Language selection", language_strings=language_strings) }}" aria-label="{{ macros_translate::translate(key="language_selection", default="Language selection", language_strings=language_strings) }}">
|
||||||
|
{%- if config.extra.show_selected_language_code_in_language_switcher -%}
|
||||||
|
<div class="language-switcher-icon language-switcher-icon-with-code"></div>
|
||||||
|
<div class="language-switcher-icon-code">{{lang}}</div>
|
||||||
|
{%- else -%}
|
||||||
<div class="language-switcher-icon"></div>
|
<div class="language-switcher-icon"></div>
|
||||||
|
{%- endif -%}
|
||||||
</summary>
|
</summary>
|
||||||
<div class="dropdown-content" role="menu">
|
<div class="dropdown-content" role="menu">
|
||||||
{#- Display the current language first in the dropdown -#}
|
{#- Display the current language first in the dropdown -#}
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ skin = ""
|
|||||||
# browser_theme_color = "#087e96" # Example of single value.
|
# browser_theme_color = "#087e96" # Example of single value.
|
||||||
# browser_theme_color = ["#ffffff", "#000000"] # Example of light/dark colours.
|
# browser_theme_color = ["#ffffff", "#000000"] # Example of light/dark colours.
|
||||||
|
|
||||||
|
# Show current language code on the language switcher
|
||||||
|
show_selected_language_code_in_language_switcher = false
|
||||||
|
|
||||||
# List additional stylesheets to load site-wide.
|
# List additional stylesheets to load site-wide.
|
||||||
# These stylesheets should be located in your site's `static` directory.
|
# These stylesheets should be located in your site's `static` directory.
|
||||||
# Example: stylesheets = ["extra1.css", "path/extra2.css"]
|
# Example: stylesheets = ["extra1.css", "path/extra2.css"]
|
||||||
|
|||||||
Reference in New Issue
Block a user