FIX use the same translation variable key as core (#755)

This way when this translation string overrides the core one, the core
triggered translations will still continue working.
This commit is contained in:
Dylan Wagstaff 2018-03-29 09:29:15 +13:00 committed by Robbie Averill
parent 20d778bfa6
commit 569b0a7627
2 changed files with 2 additions and 2 deletions

View File

@ -806,7 +806,7 @@ class EditableFormField extends DataObject
public function getErrorMessage()
{
$title = strip_tags("'". ($this->Title ? $this->Title : $this->Name) . "'");
$standard = _t('SilverStripe\\Forms\\Form.FIELDISREQUIRED', '{field} is required.', ['field' => $title]);
$standard = _t('SilverStripe\\Forms\\Form.FIELDISREQUIRED', '{name} is required.', ['name' => $title]);
// only use CustomErrorMessage if it has a non empty value
$errorMessage = (!empty($this->CustomErrorMessage)) ? $this->CustomErrorMessage : $standard;

View File

@ -22,7 +22,7 @@ en:
PLURALNAME: Pages
SINGULARNAME: Page
SilverStripe\Forms\Form:
FIELDISREQUIRED: '{field} is required'
FIELDISREQUIRED: '{name} is required'
SilverStripe\Forms\GridField\GridField:
Filter: Filter
ResetFilter: Reset