Permalink
Browse files

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.
  • Loading branch information...
1 parent 24ce0c1 commit 18a40b4b5d1f3e5083e3691f3ddcb7b20ce7f0d6 Ruud Arentsen committed with chillu Jul 26, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 code/model/SiteConfig.php
View
12 code/model/SiteConfig.php
@@ -205,11 +205,13 @@ static function make_site_config($locale = null) {
$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

0 comments on commit 18a40b4

Please sign in to comment.