Skip to content

Instantly share code, notes, and snippets.

@gordonbanderson
Created March 18, 2013 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gordonbanderson/5187802 to your computer and use it in GitHub Desktop.
Save gordonbanderson/5187802 to your computer and use it in GitHub Desktop.
Get translatable strings working in silverstripe templates
public function init() {
parent::init();
// needed for _t to work, see http://doc.silverstripe.org/multilingualcontent#setting_the_i18n_locale
if($this->dataRecord->hasExtension('Translatable')) {
i18n::set_locale($this->dataRecord->Locale);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment