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

Archive Plus plugin: How to add new translation

Solved by Vadym View solution

Started by Mikkeli Kerttunen 3 years ago · 6 replies · 698 views
3 years ago Solution

@mikselli, try add to the language file of your inheritance theme some translation you need, just change the values of MONTHS and SHORT_MONTHS to Finnish

YAML
fi:
  PLUGINS:
    ARCHIVE_PLUS:
      MONTHS: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
      SHORT_MONTHS: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
👍 1
3 years ago

@pikim, That would be a smart choice if author was still around... There are 2 other language pull requests still open since 2017 and 2018...

3 years ago

One problem still regarding the date translation. I found a way to change the date format but can't find the way to change these blog's month names to Finnish:

Clipboard02|348x500

3 years ago

Little more Google search and it was simple to do with this instruction:
https://learn.getgrav.org/17/cookbook/twig-recipes#displaying-a-translated-month

I changed the theme/templates/partials/blog/date.html.twig file to this:

TWIG
<span class="blog-date">
    <time class="dt-published" datetime="{{ page.date|date("c") }}">
        <i class="fa fa-calendar"></i> {{ post.date|date('j.') }}{{ 'GRAV.MONTHS_OF_THE_YEAR'|ta(post.date|date('n') - 1)}}ta {{ post.date|date('Y') }}
    </time>
</span>

last edited 01/13/23 by Mikkeli Kerttunen

Suggested topics

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