Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 18a40b4b5d1f3e5083e3691f3ddcb7b20ce7f0d6 1 parent 24ce0c1
Ruud Arentsen roed authored chillu committed
Showing with 7 additions and 5 deletions.
  1. +7 −5 code/model/SiteConfig.php
12 code/model/SiteConfig.php
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.