Hey there,

how can i change the month from the english word to the german, e.g. october to oktober

Thanks, Batman1983

Comments

greggles’s picture

Title: Translate month? » Translate month from october to oktober?
Project: Pathauto » Token
Version: 5.x-2.x-dev » 5.x-1.x-dev

I believe this is more of a token question than a pathauto question.

What pattern are you using that gets replaced with "october" ?

greggles’s picture

According to http://php.net/date:

To format dates in other languages, you should use the
setlocale() and strftime()
functions instead of date().

However, batman1983 and I debugged this for a while in irc and when he entered print date('F'); into a php filtered node it printed oktober.

So, I'm not completely sure what the solution is.

batman1983’s picture

I changed some lines like this:

$values['month']          = strftime('%B', $node->created);
	$values['mon']            = strftime('%b', $node->created);

but you have to add this code anywhere for your country:

 setlocale(LC_ALL, 'de_DE'); // location for germany

Perhaps you can read the location from the drupal core....

Dave Reid’s picture

Status: Active » Closed (duplicate)

Marking this as a duplicate issue of #433486: Use format_date() for translatable date tokens