Skip to content

Commit

Permalink
Localization for months (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel authored Feb 18, 2021
1 parent 03e41b5 commit 9cb4af1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions _data/language.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ str_javascript_required_disqus: "Please enable JavaScript to view comments."
str_no_result_found: "No result found"
str_cookie_approve: "Approve"
str_cookie_disclaimer: "We would like to use third party cookies and scripts to improve the functionality of this website."
str_months: [January, February, March, April, May, June, July, August, September, October, November, December]

4 changes: 3 additions & 1 deletion _includes/post_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
<img alt="Author's avatar" src="{{ author.avatar | relative_url }}">
{% endif %}
<p class="meta">
{% if author.name %}{{ author.name }} - {% endif %}{{ date | date: "%B %-d, %Y" }}
{% if author.name %}{{ author.name }} - {% endif %}
{% assign x = date | date: "%m" | minus: 1 %}
{{ site.data.language.str_months[x] | default: date | date: "%B" }} {{ date | date: "%d, %Y" }}
</p>
{%- if author.url -%}</a>{%- endif -%}
</div>

0 comments on commit 9cb4af1

Please sign in to comment.