From b1ee36e3aa593884c208d005aac21bd840221908 Mon Sep 17 00:00:00 2001 From: martimiz Date: Wed, 8 Aug 2012 17:30:20 +0200 Subject: [PATCH 1/5] Fix: display the correct (menu) icon in the GridFieldDetailForm's breadcrumbs. In CMSBreadcrumbs.ss the (TopLevel)Controller is not recognized within the Breadcrumbs loop, so the class that is used in css to style the icon cannot be created. Moving the construction outside the loop will remedy this. As far as I can see this works within the CMS. --- admin/templates/CMSBreadcrumbs.ss | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/admin/templates/CMSBreadcrumbs.ss b/admin/templates/CMSBreadcrumbs.ss index 92ad8ea6a..e5ddd23bd 100644 --- a/admin/templates/CMSBreadcrumbs.ss +++ b/admin/templates/CMSBreadcrumbs.ss @@ -1,22 +1,19 @@ From deb3780a451461b3d9879eafe1377dfdd1024812 Mon Sep 17 00:00:00 2001 From: martimiz Date: Thu, 9 Aug 2012 23:46:40 +0200 Subject: [PATCH 2/5] BUG #7768 - add-button and breadcrumb translation in Security, ModelAdmin The classnames on the add-new button and breadcrumbs were not translated due to the use of singular_name() instead of i18n-singular_name() in GridFieldAddNewButton and GridFieldDetailForm. --- forms/gridfield/GridFieldAddNewButton.php | 2 +- forms/gridfield/GridFieldDetailForm.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/gridfield/GridFieldAddNewButton.php b/forms/gridfield/GridFieldAddNewButton.php index 126cead36..fabd75146 100644 --- a/forms/gridfield/GridFieldAddNewButton.php +++ b/forms/gridfield/GridFieldAddNewButton.php @@ -23,7 +23,7 @@ class GridFieldAddNewButton implements GridField_HTMLProvider { public function getHTMLFragments($gridField) { if(!$this->buttonName) { // provide a default button name, can be changed by calling {@link setButtonName()} on this component - $this->buttonName = _t('GridField.Add', 'Add {name}', array('name' => singleton($gridField->getModelClass())->singular_name())); + $this->buttonName = _t('GridField.Add', 'Add {name}', array('name' => singleton($gridField->getModelClass())->i18n_singular_name())); } $data = new ArrayData(array( diff --git a/forms/gridfield/GridFieldDetailForm.php b/forms/gridfield/GridFieldDetailForm.php index 28bfbb02f..f739514df 100644 --- a/forms/gridfield/GridFieldDetailForm.php +++ b/forms/gridfield/GridFieldDetailForm.php @@ -464,7 +464,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler { ))); } else { $items->push(new ArrayData(array( - 'Title' => sprintf(_t('GridField.NewRecord', 'New %s'), $this->record->singular_name()), + 'Title' => sprintf(_t('GridField.NewRecord', 'New %s'), $this->record->i18n_singular_name()), 'Link' => false ))); } From 77d939f0b269d90ac8ded404ec549e376357f95e Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 9 Aug 2012 23:55:30 +0200 Subject: [PATCH 3/5] CMS Localization --- admin/code/LeftAndMain.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 7d775bb43..9f45ea6c0 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -1165,7 +1165,7 @@ class LeftAndMain extends Controller implements PermissionProvider { ), new FieldList( // TODO i18n - new FormAction('submit', "Go") + new FormAction('submit', _t('Form.SubmitBtnLabel', "Go")) ) ); $form->addExtraClass('cms-batch-actions nostyle'); From ca1d38dffdb7e9657aafaf070c2d8de2c88f8208 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 10 Aug 2012 00:14:02 +0200 Subject: [PATCH 4/5] BUG Localize DataObject->summaryFields() --- model/DataObject.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/model/DataObject.php b/model/DataObject.php index 6a1bed964..d7f5db288 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -3156,6 +3156,10 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity // Final fail-over, just list ID field if(!$fields) $fields['ID'] = 'ID'; + + // Localize fields (if possible) + $labels = $this->fieldLabels(false); + $fields = array_intersect_key($labels, $fields); return $fields; } From c7fd9a6605ea01a7124dc5002c53a1a48c9475a7 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 10 Aug 2012 00:17:34 +0200 Subject: [PATCH 5/5] CMS Localization --- admin/code/SecurityAdmin.php | 2 +- admin/templates/Includes/LeftAndMain_Menu.ss | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/code/SecurityAdmin.php b/admin/code/SecurityAdmin.php index 0766c2ada..77c213a83 100755 --- a/admin/code/SecurityAdmin.php +++ b/admin/code/SecurityAdmin.php @@ -109,7 +109,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { ) ) ), - $groupsTab = new Tab('Groups', singleton('Group')->plural_name(), + $groupsTab = new Tab('Groups', singleton('Group')->i18n_plural_name(), $groupList, new HeaderField(_t('SecurityAdmin.IMPORTGROUPS', 'Import groups'), 3), new LiteralField( diff --git a/admin/templates/Includes/LeftAndMain_Menu.ss b/admin/templates/Includes/LeftAndMain_Menu.ss index e92190559..815c0a507 100644 --- a/admin/templates/Includes/LeftAndMain_Menu.ss +++ b/admin/templates/Includes/LeftAndMain_Menu.ss @@ -33,12 +33,12 @@