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.

All other Modules /

Discuss all other Modules here.

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

get all translations from a specific namespace


Go to End


2 Posts   1307 Views

Avatar
joern

Community Member, 28 Posts

15 March 2012 at 8:41am

Edited: 15/03/2012 8:42am

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

Avatar
swaiba

Forum Moderator, 1899 Posts

16 March 2012 at 12:05am

how about...

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