Grave updated issue: MONTHS_OF_THE_YEAR[7] 15, 2018

#1

good afternoon all,
I just upgrade grav to v1.6.3 - Admin v1.9.0 and the dates in the webpage look like this: MONTHS_OF_THE_YEAR[7] 15, 2018
I also update the plugins.

What should I change to fix this issue? Im using custom template from gateway.

thanks in advance
Carlos.

#2

Hi there,

try to setup a languages file in /usr/languages/en.yaml with:

MONTHS_OF_THE_YEAR: [January, ... ]
#3

thanks a lot npetri, I dont have that folder…
neverheless I found this in …\user\themes\gateway\templates\partials:

{% if truncate %}
<div class="entry-date">
  {{ 'MONTHS_OF_THE_YEAR'|ta(page.date|date('n') - 1) }} {{ page.date|date('d, Y') }}
</div>
{% endif %}

{% if not truncate %}
<div class="entry-meta">
  <span class="posted-on">Posted on
    <a href="{{ page.url }}" rel="bookmark">
      <time class="entry-date published" datetime="{{ 'MONTHS_OF_THE_YEAR'|ta(page.date|date('n') - 1) }} {{ page.date|date('d, Y') }}">
        {{ 'MONTHS_OF_THE_YEAR'|ta(page.date|date('n') - 1) }} {{ page.date|date('d, Y') }}
      </time>

its here?
best
Carlos

#4

MONTHS_OF_THE_YEAR is used within this template to translate the date to different languages. Grav looks in different files for a translation. As is said, create a file named en.yaml (for english, de for german etc) in /usr/languages with the following content:

MONTHS_OF_THE_YEAR: [January, February, March, April, May, June, July, August, September, October, November, December]

Another way is to create a languages.yaml file in the theme folder directly. But the syntax is as follows:

en:
  MONTHS_OF_THE_YEAR: [January, February, March, April, May, June, July, August, September, October, November, December]

I hope it works. :crossed_fingers:

#5

With theme folder i meant /usr/themes/gateway