Snippets - Little bits of code to make you happy
Using Dates in Foreign Languages
Tweet17 November 2009 | | | Supports v2.4, v2.3
With all the translatable, i18n and other translation related stuff in silverstripe, I think more than one is wondering how to achieve something simple as using dates in a foreign language... Actually, it's ultra easy if you add this 2 lines in your silverstripe powered website.
Here is my Spanish example:
_config.php
setlocale(LC_ALL, 'es_ES');
Then in your template$Date.FormatI18N(%A %e de %B de %Y)
This will render
miércoles 21 de octubre de 2009
1 Comments
RSS feed for comments on this page RSS feed for all comments
Nobrainer Web
13/02/2013 10:39am (3 months ago)
Hi Aram, i just needed some info regarding dates matching the current language, and i came across this post.
I was actually looking for the system to display a different date format depending on the current language of the site.
I found the following post very helpfull and thought i would share it here: http://www.silverstripe.org/blog-module-forum/show/6069?start=8#post301102
Thomas
Post a comment ...
You cannot post comments until you have logged in. Login Here.