From aa0f54fa970ba6c303e68da68b56c472a1529444 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 14 Dec 2008 21:45:46 +0000 Subject: [PATCH] ENHANCEMENT Appending classnames to translated pagetype titles in CMSMain->getPageTypes() when the cms is loaded in a non-english version - see inline comment git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@68818 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/CMSMain.php b/code/CMSMain.php index 0122d90b..c74f6ef6 100644 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -334,6 +334,14 @@ JS; if($instance->stat('need_permission') && !$this->can(singleton($class)->stat('need_permission'))) continue; $addAction = $instance->i18n_singular_name(); + + // if we're in translation mode, the link between the translated pagetype + // title and the actual classname might not be obvious, so we add it in parantheses + // Example: class "RedirectorPage" has the title "Weiterleitung" in German, + // so it shows up as "Weiterleitung (RedirectorPage)" + if(i18n::get_locale() != 'en_US') { + $addAction .= " ({$class})"; + } $result->push(new ArrayData(array( 'ClassName' => $class,