Skip to content
● Critical PHP security fixes are out: update PHP on your Grav sites. What to do →

Archive Plus plugin: How to add new translation

Solved by Vadym View solution

Started by Mikkeli Kerttunen 4 years ago · 6 replies · 1039 views
4 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
1 reply
4 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...

4 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

4 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 DrPen, 2 days ago
1 66 4 hours ago
Plugins · by renedebaaij, 1 week ago
1 134 3 days ago
Plugins · by Thomas, 6 days ago
1 143 5 days ago
Plugins · by complanar, 4 weeks ago
6 470 3 weeks ago
Plugins · by BenLaKnet, 3 weeks ago
1 294 3 weeks ago