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.
This commit is contained in:
martimiz 2012-08-09 23:46:40 +02:00 committed by Ingo Schommer
parent 61ea58d030
commit deb3780a45
2 changed files with 2 additions and 2 deletions

View File

@ -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(

View File

@ -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
)));
}