Juerg
June 1, 2018, 1:14pm
#1
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');
Juerg
June 5, 2018, 9:25am
#3
I’ve added the line in config.php - but the magic doesn’t happen. Anything else I can try?
Juerg
June 11, 2018, 1:30pm
#4
@pulsecms Any update on that?
Oliver
June 11, 2018, 2:34pm
#5
Hi Juerg,
Here is my way of using German month names with setlocale.
($newLocale = setlocale(LC_ALL, 'de_DE', 'de_DE.UTF-8');
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
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
2 Likes
Juerg
June 12, 2018, 11:40am
#7
Thanks, Oliver for taking the time to explain. That’s what I was looking for. Worked like a charm .
2 Likes
system
closed
June 26, 2018, 11:40am
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.