Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » get all translations from a specific namespace

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 468 Views
  • joern
    Avatar
    Community Member
    28 Posts

    get all translations from a specific namespace Link to this post

    hi,
    i would like to get all translations from a specific namespace. for example:

    _t('LeftAndMain.HELLO','Site content',PR_HIGH,'Menu title');
    _t('LeftAndMain.FILESIMAGES','Files & Images',PR_HIGH);
    _t('LeftAndMain.NEWSLETTERS','Newsletters');

    my getLocale('LeftAndMain') function would return:

    array(
    'HELLO' => 'Site content'
    'FILESIMAGES' => 'Files & Images',
    'NEWSLETTERS' => 'Newsletters',
    );

    something like that…

    how can i access the $lang variable in my Controller?

    thanks
    Joern

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: get all translations from a specific namespace Link to this post

    how about...

    global $lang;
    print_r($lang);
    die();

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