Opening Times

List opening times in the frontend area

Back to Opening Times Support

Mr Hound
Mr Hound

Hi,

There is a nice idea behind this plugin but it really needs better support for different languages.
The variable otNextOpen contains pieces of German language.

I make some changes :

  • Opening Times version : 1.0.2
  • file : plugins/zwiebl/openingtimes/components/ListOpeningTimes.php
  • function : nextOpen
  • line : 47
  • code :
    Before:
    $nextOpenLFormat = '';
    if ($this->page['activeLocale'] == 'en') {
        $nextOpen->setLocale('en');
        setlocale(LC_TIME, 'en_US.utf8');
        $nextOpenLFormat = $nextOpen->formatLocalized('%A, %B %d. %Y - %l:%M%P');
    }
    else {
        $nextOpen->setLocale('de');
        setlocale(LC_TIME, 'de_DE.utf8');
        $nextOpenLFormat = $nextOpen->formatLocalized('%A, %d. %B %Y - %H:%M Uhr');
    }

    After

    $nextOpenLFormat = '';
    $nextOpen->setLocale( config('app.locale') );
    setlocale(LC_TIME, config('app.locale') );
    $nextOpenLFormat = $nextOpen->formatLocalized('%A, %d. %B %Y - %H:%M');

French translation added, see merge Requests #1

Alpen.Space
Alpen.Space

Hi Mr Hound, thanks for your contribution. i merged the changes and created an update package.

if anyone else wants to add a language, you can find the language files there.

Thank you!

1-2 of 2