Home

Using dates in foreign Languages

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: (my spanish example)

in _config.php:

in your template:

this will render:
miércoles 21 de octubre de 2009

About the Author

Name: Francisco Arenas

Website: www.dospuntocero.cl

With experience in more than 5 countries, at Dospuntocero Ltd we provide quality SilverStripe services such as custom module development, psd to SilverStripe, themes and templating for designers.

Comments (5)

  • @Ricardo, no Bolsa electrónica was made in another platform a really ugly one made in Java.

    Posted by francisco, 16/12/2009 7:33pm (7 months ago)

  • Be carefull with this if you run a multilangual site, the setlocale needs to be set at the right place language files in the lang/ folder is a good one, I've seen some weird things with setlocale and i18n::setlocale where dates in a list were all traducted except the 1st item.

    Posted by Francis Belanger, 30/11/2009 8:27pm (8 months ago)

  • setlocale is a php function, not a SilverStripe function.
    Awesome tip Francisco, I've been having problems with dates so I'm definately going to try this out instead of the nasty hack I made.

    Posted by Marcus, 11/11/2009 8:11am (9 months ago)

  • Where does the function setlocale come from? I use 2.3.3 and I did not find it.

    Posted by baba-papa, 10/11/2009 2:35am (9 months ago)

  • Francisco the site Bolsa Electrónica was created using SS? thanks for tip.

    Posted by Ricardo Cardona, 08/11/2009 7:57am (9 months ago)

RSS feed for comments on this page RSS feed for all comments

Post your comment