diff --git a/core/model/VirtualPage.php b/core/model/VirtualPage.php index abd83a8d6..c2d77ec29 100755 --- a/core/model/VirtualPage.php +++ b/core/model/VirtualPage.php @@ -30,7 +30,8 @@ class VirtualPage extends Page { "Sort", "Status", 'ShowInMenus', - 'ShowInSearch' + 'ShowInSearch', + 'Locale' ); $allFields = $this->db(); diff --git a/tests/model/TranslatableTest.php b/tests/model/TranslatableTest.php index bbb06cb9b..adf71163b 100755 --- a/tests/model/TranslatableTest.php +++ b/tests/model/TranslatableTest.php @@ -681,6 +681,21 @@ class TranslatableTest extends FunctionalTest { ); } + function testLocalePersistsInAllPageTypes() { + $types = ClassInfo::subclassesFor('SiteTree'); + foreach($types as $type) { + if(singleton($type) instanceof TestOnly) continue; + + $enPage = new $type(); + $enPage->Locale = 'en_US'; + $enPage->write(); + + $dePage = $enPage->createTranslation('de_DE'); + $dePage->write(); + $this->assertEquals('de_DE', $dePage->Locale, "Page type $type retains Locale property"); + } + } + function testGetTranslationByStage() { $publishedPage = new SiteTree(); $publishedPage->Locale = 'en_US';