Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

edit month names? (e.g. January -> Januar / March -> März / ...)


Go to End


2 Posts   1430 Views

Avatar
benni91

Community Member, 72 Posts

29 August 2011 at 1:51am

Edited: 29/08/2011 1:52am

Hi @ all,
Can someone tell me where i can find the month names?
i want that the months are displayed in german language and not in english.

I searched a view files. but the cms structure and the amount of files is to complex for me :D perhaps someone knows it :)

thx
benni

Avatar
martimiz

Forum Moderator, 1391 Posts

29 August 2011 at 6:11am

The month names aren't really anywhere. SilverStripe dates are diplayed using PHP date formatting directly. To show Date fields in German from your template, first set the desired PHP locale. For instance in your config.php:

setlocale(LC_TIME, 'de_DE');

Now in your template:

$MyDate.FormatI18N(%B)

FormatI18N() uses PHP strftime. %B will show you the monthname only. See the PHP docs for available formatting: http://php.net/manual/en/function.strftime.php