How to get the month names in current locale
SS 2.4.7
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.
Well $Now.Month returns the month name. It will return whatever locale you have set at the PHP level (setlocale()) I don't believe SS will set this automatically for you.
i use in mysite/_config.pgp lines:
i18n::set_locale('et_EE');
setlocale(LC_TIME, i18n::get_locale() . '.utf8');
But in blog module the months are still in english.
Blog module uses in posts:
$Date.Long
And in widget it also in english
got it working with code $Date.FormatDate(%d %b %Y)
But still needed the code do make ArchiveWidget to show the title in right language