diff --git a/config.toml b/config.toml index a54f0f4..245b127 100644 --- a/config.toml +++ b/config.toml @@ -184,6 +184,9 @@ iine_unified_languages = true # Can be set at section levels, following the hierarchy: section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy post_listing_index_reversed = false # Defaults to false. +# Show current language code on the language switcher +language_switcher_show_lcode = false # Defaults to false + # DEPRECATED! # Use Zola's built-in `bottom_footnotes = true` in the [markdown] section instead. (Available since v0.19.0) # Adds backlinks to footnotes (loads ~500 bytes of JavaScripts). diff --git a/content/blog/faq-languages/index.md b/content/blog/faq-languages/index.md index ac78922..f306fd6 100644 --- a/content/blog/faq-languages/index.md +++ b/content/blog/faq-languages/index.md @@ -1,7 +1,7 @@ +++ title = "Lost in Translation? Not with tabi's Multilingual Capabilities" date = 2023-09-12 -updated = 2025-08-07 +updated = 2025-08-24 description = "Master the art of serving a global audience through tabi's built-in multilingual features. Learn how to change the default language, add multilingual support, and contribute your own translations." [taxonomies] @@ -148,3 +148,7 @@ If you did, you will need to manually update the translations. You can do this b ## Does tabi translate my content? No. tabi only translates the theme's text strings. You will need to translate your content yourself. + +# How to show current language code on the language switcher? + +Add `language_switcher_show_lcode = true` in your config extras. diff --git a/sass/parts/_header.scss b/sass/parts/_header.scss index 414aa82..a5b546b 100644 --- a/sass/parts/_header.scss +++ b/sass/parts/_header.scss @@ -125,6 +125,31 @@ header { background: var(--meta-color); } } + + .language-switcher-icon-with-code { + width: 0.7rem; + height: 0.7rem; + margin-right: 0.3rem; + } +} + +.language-switcher-icon-code { + z-index: 10; + width: 100%; + height: 100%; + position: absolute; + top: -0.15rem; + color: var(--text-color); + font-weight: bold; + left: 0.6rem; + &:hover { + color: var(--meta-color); + } + font-size: 0.5rem; +} + +.language-switcher-selected-item { + font-weight: bold; } .dropdown { diff --git a/templates/partials/language_switcher.html b/templates/partials/language_switcher.html index 83cf61f..0f05f13 100644 --- a/templates/partials/language_switcher.html +++ b/templates/partials/language_switcher.html @@ -1,7 +1,12 @@