Skip to content

Commit 52d160f

Browse files
fix(i18n): localize the title (cotes2020#2610)
1 parent d2db439 commit 52d160f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

_includes/head.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,17 @@
5757

5858
<title>
5959
{%- unless page.layout == 'home' -%}
60-
{{ page.title | append: ' | ' }}
60+
{%- capture title -%}
61+
{%- if page.collection == 'tabs' -%}
62+
{%- assign tab_key = page.title | downcase -%}
63+
{{- site.data.locales[include.lang].tabs[tab_key] -}}
64+
{%- else -%}
65+
{{- page.title -}}
66+
{%- endif -%}
67+
{%- endcapture -%}
68+
{{- title | append: ' | ' -}}
6169
{%- endunless -%}
62-
{{ site.title }}
70+
{{- site.title -}}
6371
</title>
6472

6573
{% include_cached favicons.html %}

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<!-- `site.alt_lang` can specify a language different from the UI -->
1616
<html lang="{{ page.lang | default: site.alt_lang | default: site.lang }}" {{ prefer_mode }}>
17-
{% include head.html %}
17+
{% include head.html lang=lang %}
1818

1919
<body>
2020
{% include sidebar.html lang=lang %}

0 commit comments

Comments
 (0)