Skip to content

Commit

Permalink
Localize dates using Oncleben31 code
Browse files Browse the repository at this point in the history
  • Loading branch information
katesalazar committed Jan 9, 2022
1 parent eab5b39 commit a6e3c73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions _data/translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ en:
rss_feed: "Bitcoin Core Blog RSS Feed"
rss_meetings_feed: "Meetings feed"
rss_blog_feed: "Blog posts feed"
date_format: "%B %d, %Y"

zh_CN:
created: "发布在"
Expand All @@ -25,6 +26,7 @@ zh_CN:
rss_feed: "Bitcoin Core Blog RSS Feed"
rss_meetings_feed: "Meetings feed"
rss_blog_feed: "Blog posts feed"
date_format: "%B %d, %Y"

zh_TW:
created: "發表於"
Expand All @@ -39,6 +41,7 @@ zh_TW:
rss_feed: "Bitcoin Core Blog RSS Feed"
rss_meetings_feed: "Meetings feed"
rss_blog_feed: "Blog posts feed"
date_format: "%B %d, %Y"

ja:
created: "Published on the"
Expand All @@ -53,6 +56,7 @@ ja:
rss_feed: "Bitcoin Core Blog RSS Feed"
rss_meetings_feed: "Meetings feed"
rss_blog_feed: "Blog posts feed"
date_format: "%B %d, %Y"

es:
created: "Publicado el"
Expand All @@ -67,3 +71,4 @@ es:
rss_feed: "Fuente RSS del Blog de Bitcoin Core"
rss_meetings_feed: "Feed de reuniones"
rss_blog_feed: "Feed de entradas del blog"
date_format: "%d de %B de %Y"
4 changes: 3 additions & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ <h2 class="link-post"><a href="{{ post.url }}" title="{{ post.title }}">{{ post.
<h2><a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h2>
<p>{{ post.excerpt | markdownify | strip_html | truncate: 160 }}</p>
<p class="dt-published" datetime="{{ page.date | date_to_xmlschema }}">
<small>{{ site.data.home[page.lang]['published_on'] }} {{ post.date | date: "%B %d, %Y" }}</small>
{% assign dateformat=site.data.translations[page.lang].date_format %}
<small>{{ site.data.home[page.lang]['published_on'] }}
{% include translated_date.html date=post.date format=dateformat lang=page.lang %}</small>
</p>
{% endif %}
</article>
Expand Down

0 comments on commit a6e3c73

Please sign in to comment.