Skip to content
This repository
Browse code

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...
commit 18a40b4b5d1f3e5083e3691f3ddcb7b20ce7f0d6 1 parent 24ce0c1
roed authored July 26, 2012 chillu committed August 10, 2012

Showing 1 changed file with 7 additions and 5 deletions. Show diff stats Hide diff stats

  1. 12  code/model/SiteConfig.php
12  code/model/SiteConfig.php
@@ -205,11 +205,13 @@ static function make_site_config($locale = null) {
205 205
 		$siteConfig->Tagline = _t('SiteConfig.TAGLINEDEFAULT',"your tagline here");
206 206
 
207 207
 		if(class_exists('Translatable') && $siteConfig->hasExtension('Translatable')){
208  
-			$defaultConfig = DataObject::get_one('SiteConfig');
209  
-			if($defaultConfig){
210  
-				$siteConfig->Title = $defaultConfig->Title;
211  
-				$siteConfig->Tagline = $defaultConfig->Tagline;
212  
-			}
  208
+			Translatable::disable_locale_filter();
  209
+			$defaultConfig = SiteConfig::get()->first();
  210
+			Translatable::enable_locale_filter();			
  211
+			
  212
+			if($defaultConfig){					
  213
+				return $defaultConfig->createTranslation($locale);
  214
+			}			
213 215
 			
214 216
 			// TODO Copy view/edit group settings
215 217
 			

0 notes on commit 18a40b4

Please sign in to comment.
Something went wrong with that request. Please try again.