Archive Plus plugin: How to add new translation


Installed Grav with Quark theme. You can see it here:

I installed Archive Plus plugin.

I can’t find a way to change the calendar months from these plugins to Finnish. SIdebar title’s are working from language file, but these calendar months still stay in English.

@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

      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 Like

I would fork the plugin, add the translations to the plugins language.yaml and create a pull request. This way also other users may have a benefit.

This grav-plugin-archive-plus/archive_plus.html.twig at develop · Sommerregen/grav-plugin-archive-plus · GitHub should be the relevant twig section.

@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…

Hi! This works. Thank you! :slight_smile:

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:

Little more Google search and it was simple to do with this instruction:

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

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