Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

(SOLVED) Translation doesn't work

Solved by M View solution

Started by M 7 years ago · 2 replies · 686 views
7 years ago

I’m trying to extend the events plugin (https://github.com/kalebheitzman/grav-plugin-events ).

There are the following code snippets in calendar.html.twig:
{{ 'MONTHS_OF_THE_YEAR'|ta(calendar.date|date('n') - 1) ~ calendar.date|date(' Y') }}
and
{{ 'DAYS_OF_THE_WEEK'|ta(6) }}
which should translate the current month and the current weekday.

But on the resulting page I can only see
MONTHS_OF_THE_YEAR[8] 2019
and
DAYS_OF_THE_WEEK[6]

What's wrong with the Twig code? Regarding the manual this should work as far as I understand it.

7 years ago Solution

Thanks to a bug report I found the solution:
it has to be 'GRAV.MONTHS_OF_THE_YEAR' not 'MONTHS_OF_THE_YEAR'.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 47 1 week ago
Plugins · by Xavier, 4 weeks ago
2 56 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1182 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 50 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 74 2 months ago