Skip to content
This repository
Browse code

BUG #7768 - add-button and breadcrumb translation in Security, ModelA…

…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...
commit deb3780a451461b3d9879eafe1377dfdd1024812 1 parent 61ea58d
Martimiz authored August 09, 2012 chillu committed August 09, 2012
2  forms/gridfield/GridFieldAddNewButton.php
@@ -23,7 +23,7 @@ public function __construct($targetFragment = 'before') {
23 23
 	public function getHTMLFragments($gridField) {
24 24
 		if(!$this->buttonName) {
25 25
 			// provide a default button name, can be changed by calling {@link setButtonName()} on this component
26  
-			$this->buttonName = _t('GridField.Add', 'Add {name}', array('name' => singleton($gridField->getModelClass())->singular_name()));
  26
+			$this->buttonName = _t('GridField.Add', 'Add {name}', array('name' => singleton($gridField->getModelClass())->i18n_singular_name()));
27 27
 		}
28 28
 
29 29
 		$data = new ArrayData(array(
2  forms/gridfield/GridFieldDetailForm.php
@@ -464,7 +464,7 @@ function Breadcrumbs($unlinked = false) {
464 464
 			)));	
465 465
 		} else {
466 466
 			$items->push(new ArrayData(array(
467  
-				'Title' => sprintf(_t('GridField.NewRecord', 'New %s'), $this->record->singular_name()),
  467
+				'Title' => sprintf(_t('GridField.NewRecord', 'New %s'), $this->record->i18n_singular_name()),
468 468
 				'Link' => false
469 469
 			)));	
470 470
 		}

0 notes on commit deb3780

Please sign in to comment.
Something went wrong with that request. Please try again.