Jump to:

3435 Posts in 1026 Topics by 866 members

Template Questions

SilverStripe Forums » Template Questions » LastEdited.Ago

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

Page: 1
Go to End
Author Topic: 994 Views
  • mol
    Avatar
    Community Member
    5 Posts

    LastEdited.Ago Link to this post

    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

  • mol
    Avatar
    Community Member
    5 Posts

    Re: LastEdited.Ago Link to this post

    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.

  • mol
    Avatar
    Community Member
    5 Posts

    Re: LastEdited.Ago Link to this post

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

    994 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.