Jump to:

22977 Posts in 11806 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » edit month names? (e.g. January -> Januar / March -> März / ...)

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

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

Page: 1
Go to End
Author Topic: 808 Views
  • benni91
    Avatar
    Community Member
    72 Posts

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

    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 perhaps someone knows it

    thx
    benni

  • martimiz
    Avatar
    Forum Moderator
    1037 Posts

    Re: edit month names? (e.g. January -> Januar / March -> März / ...) Link to this post

    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

    808 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.