Skip to content

Commit 44f646c

Browse files
committed
Introduce some localizations into the news layouts
Localize the "Continue Reading..." links and the sidebar titles ("Archives by Year/Month"). Instead of "2013 Archives" use only the year as sidebar link.
1 parent ed6eeeb commit 44f646c

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

_layouts/news.html

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
layout: default
33
---
44

5+
{% if site.locales.news[page.lang] %}
6+
{% assign locales = site.locales.news[page.lang] %}
7+
{% else %}
8+
{% assign locales = site.locales.news['en'] %}
9+
{% endif %}
10+
511
{% if site.locales.sidebar[page.lang] %}
612
{% assign syndicate = site.locales.sidebar[page.lang].syndicate %}
713
{% else %}
@@ -26,7 +32,7 @@ <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
2632
{{ post.content | markdownify | strip_html | truncatewords: 25 }}
2733
</p>
2834

29-
<p><a href="{{ post.url }}">Continue Reading...</a></p>
35+
<p><a href="{{ post.url }}">{{ locales.continue }}</a></p>
3036

3137
{% if post.author and post.author != "" %}
3238
<p class="post-info">{{ post.author }} &ndash; {{ post.date | date_to_string }}</p>
@@ -42,11 +48,11 @@ <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
4248
<div id="sidebar-wrapper">
4349
<div id="sidebar">
4450
<div class="navigation">
45-
<h3><strong>Archives By Year</strong></h3>
51+
<h3><strong>{{ locales.yearly_archives }}</strong></h3>
4652

4753
<ul class="menu">
4854
{% for year in page.years %}
49-
<li><a href="{{ year }}/">{{ year }} Archives</a></li>
55+
<li><a href="{{ year }}/">{{ year }}</a></li>
5056
{% endfor %}
5157
</ul>
5258
</div>

_layouts/news_archive_month.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
layout: default
33
---
44

5+
{% if site.locales.news[page.lang] %}
6+
{% assign locales = site.locales.news[page.lang] %}
7+
{% else %}
8+
{% assign locales = site.locales.news['en'] %}
9+
{% endif %}
10+
511
<div id="content-wrapper">
612
<div id="head-wrapper-1">
713
<div id="head-wrapper-2">
@@ -20,7 +26,7 @@ <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
2026
{{ post.content | markdownify | strip_html | truncatewords: 25 }}
2127
</p>
2228

23-
<p><a href="{{ post.url }}">Continue Reading...</a></p>
29+
<p><a href="{{ post.url }}">{{ locales.continue }}</a></p>
2430

2531
{% if post.author and post.author != "" %}
2632
<p class="post-info">{{ post.author }} &ndash; {{ post.date | date_to_string }}</p>

_layouts/news_archive_year.html

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
layout: default
33
---
44

5+
{% if site.locales.news[page.lang] %}
6+
{% assign locales = site.locales.news[page.lang] %}
7+
{% else %}
8+
{% assign locales = site.locales.news['en'] %}
9+
{% endif %}
10+
511
<div id="content-wrapper">
612
<div id="head-wrapper-1">
713
<div id="head-wrapper-2">
@@ -20,7 +26,7 @@ <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
2026
{{ post.content | markdownify | strip_html | truncatewords: 25 }}
2127
</p>
2228

23-
<p><a href="{{ post.url }}">Continue Reading...</a></p>
29+
<p><a href="{{ post.url }}">{{ locales.continue }}</a></p>
2430

2531
{% if post.author and post.author != "" %}
2632
<p class="post-info">{{ post.author }} &ndash; {{ post.date | date_to_string }}</p>
@@ -36,7 +42,7 @@ <h3><a href="{{ post.url }}">{{ post.title }}</a></h3>
3642
<div id="sidebar-wrapper">
3743
<div id="sidebar">
3844
<div class="navigation">
39-
<h3><strong>Archive By Month</strong></h3>
45+
<h3><strong>{{ locales.monthly_archives }}</strong></h3>
4046

4147
<ul class="menu">
4248
{% for month in page.months %}

0 commit comments

Comments
 (0)