From deb3780a451461b3d9879eafe1377dfdd1024812 Mon Sep 17 00:00:00 2001 From: martimiz Date: Thu, 9 Aug 2012 23:46:40 +0200 Subject: [PATCH] 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 126cead3662..fabd7514612 100644 --- a/forms/gridfield/GridFieldAddNewButton.php +++ b/forms/gridfield/GridFieldAddNewButton.php @@ -23,7 +23,7 @@ public function __construct($targetFragment = 'before') { 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 28bfbb02fc3..f739514dfb9 100644 --- a/forms/gridfield/GridFieldDetailForm.php +++ b/forms/gridfield/GridFieldDetailForm.php @@ -464,7 +464,7 @@ function Breadcrumbs($unlinked = false) { ))); } 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 ))); }