Hi,
I used a pre-built template for my site and wanted to change the names of months to my local language, but don’t know how to implment it in the current code.
I want to change:
January - Januar
February - Februar
March - Marec
and so forth.
I found the code, but don’t have much experience with liquid:
{% assign m = page.date | date: “%-m” %}
{{ page.date | date: “%-d” }}
{% case m %}
{% when ‘1’ %}Januar
{% when ‘2’ %}Februar
{% when ‘3’ %}März
{% when ‘4’ %}April
{% when ‘5’ %}Mai
{% when ‘6’ %}Juni
{% when ‘7’ %}Juli
{% when ‘8’ %}August
{% when ‘9’ %}September
{% when ‘10’ %}Oktober
{% when ‘11’ %}November
{% when ‘12’ %}Dezember
{% endcase %}
{{ page.date | date: “%Y” }}
Thank you Michael,
I put the snippet here _includes/locale-date.html but now I don’t know how/where do I include this {% include locale-date.html %} in the code below
—
layout: default
—
If you want to keep the month heading and day under as before but just use to locale month, then you could do this.
Setup includes file to be month. No year. No day.
_includes/locale-date.html
{% assign m = page.date | date: “%-m” %}
{% case m %}
{% when ‘1’ %}Januar
{% when ‘2’ %}Februar
{% when ‘3’ %}März
{% when ‘4’ %}April
{% when ‘5’ %}Mai
{% when ‘6’ %}Juni
{% when ‘7’ %}Juli
{% when ‘8’ %}August
{% when ‘9’ %}September
{% when ‘10’ %}Oktober
{% when ‘11’ %}November
{% when ‘12’ %}Dezember
{% endcase %}
But it is trickier to get that to fit into the snippet you sent because of use of post.next and having to pass a date to the includes.