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.

Forum Module /

Discuss the Forum Module.

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

how/what does _t mean?


Go to End


2 Posts   3273 Views

Avatar
wildflower1975

Community Member, 63 Posts

18 February 2010 at 3:00pm

Edited: 18/02/2010 4:26pm

It's in the ForumRole.php hence the post in here,

new CheckableOption('CompanyPublic', new TextField('Address', _t('ForumRole.COMPANY', 'Company')), true),

I'm guessing that it tests for the existence of a Constant (which as far as I can see isn't set anywhere in v2.5) and so returns Company in the call above.

I'd like to know where this function/method called _t is?

should it be used in other places? is it a relic from version 0.0.0.1? I've read it could be a private method but don't know where to look.

cheers

possible answer = I think it's something to do with internationalization - i18n

Avatar
Willr

Forum Moderator, 5523 Posts

18 February 2010 at 4:53pm

_t is the translation function. You'll see it throughout all the modules and all the core. See http://doc.silverstripe.org/doku.php?id=i18n#the_t_function for more information