From 18a40b4b5d1f3e5083e3691f3ddcb7b20ce7f0d6 Mon Sep 17 00:00:00 2001 From: Ruud Arentsen Date: Thu, 26 Jul 2012 15:13:22 +0200 Subject: [PATCH 1/2] BUG Adding siteconfig translations translations were not added in the same translation group, and the translation module didn't work. Also commited changes in the translation module, which will need this commit. --- code/model/SiteConfig.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/model/SiteConfig.php b/code/model/SiteConfig.php index 66da02cf..89ea9a85 100644 --- a/code/model/SiteConfig.php +++ b/code/model/SiteConfig.php @@ -205,11 +205,13 @@ class SiteConfig extends DataObject implements PermissionProvider { $siteConfig->Tagline = _t('SiteConfig.TAGLINEDEFAULT',"your tagline here"); if(class_exists('Translatable') && $siteConfig->hasExtension('Translatable')){ - $defaultConfig = DataObject::get_one('SiteConfig'); - if($defaultConfig){ - $siteConfig->Title = $defaultConfig->Title; - $siteConfig->Tagline = $defaultConfig->Tagline; - } + Translatable::disable_locale_filter(); + $defaultConfig = SiteConfig::get()->first(); + Translatable::enable_locale_filter(); + + if($defaultConfig){ + return $defaultConfig->createTranslation($locale); + } // TODO Copy view/edit group settings From 4bbd90487b4ff0efa4bcb89085b87f4ebb764cb4 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Sun, 12 Aug 2012 14:44:48 +1200 Subject: [PATCH 2/2] BUG fix getting translated string for page type description (Fixes #7781). --- code/controllers/CMSMain.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 9c00727d..11b53ef6 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -466,9 +466,15 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $addAction = $instance->i18n_singular_name(); // Get description - $description = _t($class . 'DESCRIPTION'); - if(!$description) $description = $instance->uninherited('description'); - if($class == 'Page' && !$description) $description = singleton('SiteTree')->uninherited('description'); + $description = _t($class . '.DESCRIPTION'); + + if(!$description) { + $description = $instance->uninherited('description'); + } + + if($class == 'Page' && !$description) { + $description = singleton('SiteTree')->uninherited('description'); + } $result->push(new ArrayData(array( 'ClassName' => $class, @@ -480,6 +486,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr } $result = $result->sort('AddAction'); + return $result; }