Skip to content

Commit

Permalink
BUG #7768 - add-button and breadcrumb translation in Security, ModelA…
Browse files Browse the repository at this point in the history
…dmin

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.
  • Loading branch information
Martimiz authored and chillu committed Aug 9, 2012
1 parent 61ea58d commit deb3780
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion forms/gridfield/GridFieldAddNewButton.php
Expand Up @@ -23,7 +23,7 @@ public function __construct($targetFragment = 'before') {
public function getHTMLFragments($gridField) { public function getHTMLFragments($gridField) {
if(!$this->buttonName) { if(!$this->buttonName) {
// provide a default button name, can be changed by calling {@link setButtonName()} on this component // 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( $data = new ArrayData(array(
Expand Down
2 changes: 1 addition & 1 deletion forms/gridfield/GridFieldDetailForm.php
Expand Up @@ -464,7 +464,7 @@ function Breadcrumbs($unlinked = false) {
))); )));
} else { } else {
$items->push(new ArrayData(array( $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 'Link' => false
))); )));
} }
Expand Down

0 comments on commit deb3780

Please sign in to comment.