From 9a6fd502b7a7c213cb8edc74fa1ebcd654ebfbb1 Mon Sep 17 00:00:00 2001 From: Niklas Forsdahl Date: Fri, 28 Sep 2012 11:53:43 +0300 Subject: [PATCH] ENHANCEMENT: Made title, cmstitle and description on widgets translatable Made title, cmsTitle and description properties translatable for widgets by using the _t() function in the properties respective getters (using the static property as the default translation as not to change the behaviour when no translations exist). Uppercase TITLE, CMSTITLE and DESCRIPTION translation strings used... --- code/model/Widget.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/model/Widget.php b/code/model/Widget.php index 3ddfd9e..cb9cebd 100644 --- a/code/model/Widget.php +++ b/code/model/Widget.php @@ -65,15 +65,15 @@ class Widget extends DataObject { } function Title() { - return Object::get_static($this->class, 'title'); + return _t($this->class.'.TITLE', Object::get_static($this->class, 'title')); } function CMSTitle() { - return Object::get_static($this->class, 'cmsTitle'); + return _t($this->class.'.CMSTITLE', Object::get_static($this->class, 'cmsTitle')); } function Description() { - return Object::get_static($this->class, 'description'); + return _t($this->class.'.DESCRIPTION', Object::get_static($this->class, 'description')); } function DescriptionSegment() {