Pulse4 - blog date format support for other languages

Generally speaking it’s about support for date formats used in Pulse for foreign languages (other than english).

To be more specific in my case:
Is there a way to format a blog date in Pulse V4 for German? e.g. 24. Oct. 2017 (10-24-2017) will be displayed as 24. Okt. 2017?

Line 47 in the config.php:

$date_format = "M j, Y"; // More: https://php.net/manual/en/function.date.php

But if you want to add German dates you might need to add something like:

$newLocale = setlocale(LC_TIME, 'de_DE', 'de_DE.UTF-8');

I’ve added the line in config.php - but the magic doesn’t happen. Anything else I can try?

@pulsecms Any update on that?

Hi Juerg,

Here is my way of using German month names with setlocale.
($newLocale = setlocale(LC_ALL, 'de_DE', 'de_DE.UTF-8');

  1. Go to config.php and change the date format variable to $date_format = "%d. %B %Y";
    or whatever you like from http://php.net/manual/de/function.strftime.php

  2. Go to inc/tags/blog.php and change the date parameter to strftime

Line 48 and 121 from

$date = date($date_format, $date_mk);
to
$date = strftime($date_format, $date_mk);

4 Likes

Excellent tutorial @Oliver - thanks for adding this here :slight_smile:

2 Likes

Thanks, Oliver for taking the time to explain. That’s what I was looking for. Worked like a charm :grinning:.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.