diff --git a/_includes/js-selector.html b/_includes/js-selector.html index b37d710..65c6453 100644 --- a/_includes/js-selector.html +++ b/_includes/js-selector.html @@ -33,7 +33,7 @@ or page.layout == 'category' or page.layout == 'tag' %} - {% assign locale = site.lang | split: '-' | first %} + {% assign locale = include.lang | split: '-' | first %} {% assign urls = urls | append: ',' diff --git a/_includes/lang.html b/_includes/lang.html index 19558a0..34b50df 100644 --- a/_includes/lang.html +++ b/_includes/lang.html @@ -1,7 +1,9 @@ {% comment %} Detect appearance language and return it through variable "lang" {% endcomment %} -{% if site.data.locales[site.lang] %} +{% if site.data.locales[page.lang] %} + {% assign lang = page.lang %} +{% elsif site.data.locales[site.lang] %} {% assign lang = site.lang %} {% else %} {% assign lang = 'en' %} diff --git a/_layouts/default.html b/_layouts/default.html index 7e355fe..6e865b9 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -13,7 +13,7 @@ layout: compress {% endif %} - + {% include head.html %} @@ -76,7 +76,7 @@ layout: compress - {% include js-selector.html %} + {% include js-selector.html lang=lang %} {% if page.mermaid %} {% include mermaid.html %}