All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Low Events Archive dates multi-language

Andrew Fairhurst 29 Aug 2013 16:07 question, complete

Hi Low,

I'm working on a multi language site using Transcribe and Low Events.

When using Low Events Archive, how can I translate {month}, without installing ee language packs (I'd prefer to use Language Locales installed on my server)?

I'd like to use the same approach as described in this support article:
Low Event Dates displayed in French or other language?

i.e. parse %U (seconds since the epoch) to exp:datetime_convert.

e.g.


{exp:low_events:archive channel="events" show_passed="yes"}
{if count == 1}<ul>{/if}
<li>
<a href="{exp:transcribe:uri path='events/date/{date_url}'}">
{exp:datetime_convert language="fr_FR" format="%B"}{month format="%U"}{/exp:datetime_convert} {year}
</a>
</li>
{if count == total_results}</ul>{/if}
{/exp:low_events:archive}


Is this possible? I think I need a new variable, which accepts the format parameter.

Many Thanks!

Andrew

Replies

  1. Low 29 Aug 2013 16:17

    That's not really possible in the Archive tag at the moment, but you could achieve it with a simple hack.

    Open up mod.low_events.php, and look up line #40. That says

    private $formats = array(


    Add a line below it, so it reads

    private $formats = array( 
    '%U' => 'timestamp',


    That should give you a {timestamp} variable in the Archive tag which you can use as input for the datetime_convert plugin.

  2. Andrew Fairhurst 30 Aug 2013 09:13

    Hi,

    That's exactly what I'm looking for. Thanks!

    N.B. The line, which you've referenced, is found here:
    system > expressionengine > third-party > low_events > mod.low_events.php

    Many thanks,

    Andrew

  3. Low 30 Aug 2013 09:41

    Oh, right, my bad. Edited my answer. :)