Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

LastEdited.Ago


Reply


3 Posts   1091 Views

Avatar
mol

Community Member, 5 Posts

14 August 2009 at 5:27am

Hello,
I'm trying to start using SilverStripe. I used $LastEdited.Ago in my template. The page is in Czech, but this shows the time always in English. The translation file (sapphire/lang/cs_CZ.php) contains correct translation of the message. So how do I tell SilverStripe to use it?

Regards,
Michal

Avatar
mol

Community Member, 5 Posts

14 August 2009 at 8:40am

I found out hack around this:
1] created this function in my page class:

function setLocale() {
i18n::set_locale(Translatable::get_current_locale());
}


and then put $setLocale on the start of my page template and it looks working.

However I'm still interested what's the correct way of doing this.

Avatar
mol

Community Member, 5 Posts

15 August 2009 at 5:16am

There is bug in the hack: do not call the method setLocale or bad things will happen!