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.
This commit is contained in:
Ruud Arentsen 2012-07-26 15:13:22 +02:00 committed by Ingo Schommer
parent 24ce0c199a
commit 18a40b4b5d

View File

@ -205,11 +205,13 @@ class SiteConfig extends DataObject implements PermissionProvider {
$siteConfig->Tagline = _t('SiteConfig.TAGLINEDEFAULT',"your tagline here"); $siteConfig->Tagline = _t('SiteConfig.TAGLINEDEFAULT',"your tagline here");
if(class_exists('Translatable') && $siteConfig->hasExtension('Translatable')){ if(class_exists('Translatable') && $siteConfig->hasExtension('Translatable')){
$defaultConfig = DataObject::get_one('SiteConfig'); Translatable::disable_locale_filter();
if($defaultConfig){ $defaultConfig = SiteConfig::get()->first();
$siteConfig->Title = $defaultConfig->Title; Translatable::enable_locale_filter();
$siteConfig->Tagline = $defaultConfig->Tagline;
} if($defaultConfig){
return $defaultConfig->createTranslation($locale);
}
// TODO Copy view/edit group settings // TODO Copy view/edit group settings