Grave updated issue: MONTHS_OF_THE_YEAR[7] 15, 2018

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.

1 Like

Hi there,

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

MONTHS_OF_THE_YEAR: [January, ... ]

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

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 /user/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:

1 Like

With theme folder i meant /user/themes/gateway

1 Like

Npetri!
You are a rock star!, it works.
Thanks so much
Carlos.

There is no need to create this file. It already exists in the directory system/languages.

What you need to do is to fix a naming bug that prevents Gateway from location this bug. You can to this by applying this GitHub pull request.

Creating an extra copy of this translation makes it harder to maintain the translations for your site.

1 Like