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.

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.

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

LastEdited.Ago


Go to End


3 Posts   1750 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!