Jump to:

3445 Posts in 1031 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » $Created.Ago in german

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

Page: 1
Go to End
Author Topic: 498 Views
  • Pipifix
    Avatar
    Community Member
    54 Posts

    $Created.Ago in german Link to this post

    Hello,

    I simple want to change the output of $Created.Ago in german translation on a current project (SS2.46). Means the string ‘(1 day ago)‘ should be ‘(vor 1 Tag)‘. My config is set to:

    i18n::set_default_locale("de_DE");
    setlocale(LC_ALL, 'de_DE');
    setlocale(LC_TIME,"de_DE.UTF-8");


    Althought i searched the forum, i did'nt found a solution. Where to look for...?
    Thanks for your help.

    Pipifix

  • Devlin
    Avatar
    Community Member
    215 Posts

    Re: $Created.Ago in german Link to this post

    i18n::set_default_lang("de_DE");
    i18n::set_locale('de_DE');
    setlocale(LC_TIME, array('de_DE.UTF-8','de_DE') );

    Works for me.

  • Pipifix
    Avatar
    Community Member
    54 Posts

    Re: $Created.Ago in german Link to this post

    Hi Devlin,

    Thanks for your reply. I've change my _config.php to your settings. but the string on the pagecomment is still the same ‘1 day ago‘. I use use the pagecomments only at the blogentry. Any other tips?

    Pipifix

  • Devlin
    Avatar
    Community Member
    215 Posts

    Re: $Created.Ago in german Link to this post

    Then I would suggest that you changed i18n:set_locale() somewhere in your code or you overloaded $lang['de_DE']['Date']['TIMEDIFFAGO'] or the language file is not loaded.
    You can check your locale if you place "echo i18n::get_locale();" & "echo _t('Date.DAYS');" in e.g. your init method. It should return "de_DE" & "Tage".

    498 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.