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
Comments
RSS feed for comments on this page RSS feed for all comments
No one has commented on this page yet.
Post a comment ...
You cannot post comments until you have logged in. Login Here.