i18n for campaigns section

This commit is contained in:
Ingo Schommer 2016-04-26 10:59:04 +12:00
parent a615dae3ac
commit c94802ea15
3 changed files with 16 additions and 4 deletions

View File

@ -464,8 +464,8 @@ JSON;
'DetailEditForm',
$fields,
FieldList::create(
FormAction::create('save', 'Save'),
FormAction::create('cancel', 'Cancel')
FormAction::create('save', _t('CMSMain.SAVE', 'Save')),
FormAction::create('cancel', _t('LeftAndMain.CANCEL', 'Cancel'))
)
);
// Configure form to respond to validation errors with form schema

View File

@ -100,6 +100,9 @@ en:
EMAIL: Email
HELLO: Hi
PASSWORD: Password
ChangeSet:
Name: Name
State: State
CheckboxField:
NOANSWER: 'No'
YESANSWER: 'Yes'
@ -334,6 +337,7 @@ en:
Image_iframe_ss:
TITLE: 'Image Uploading Iframe'
LeftAndMain:
CANCEL: Cancel
CANT_REORGANISE: 'You do not have permission to alter Top level pages. Your change was not saved.'
DELETED: Deleted.
DropdownBatchActionsDefault: 'Choose an action...'

View File

@ -346,9 +346,9 @@ class ChangeSet extends DataObject {
public function getCMSFields() {
$fields = new FieldList();
$fields->push(TextField::create('Name'));
$fields->push(TextField::create('Name', $this->fieldLabel('Name')));
if($this->isInDB()) {
$state = ReadonlyField::create('State')
$state = ReadonlyField::create('State', $this->fieldLabel('State'))
->setDontEscape(true);
$fields->push($state); // Escape is done in react
}
@ -468,4 +468,12 @@ class ChangeSet extends DataObject {
);
return $string;
}
public function fieldLabels($includerelations = true) {
$labels = parent::fieldLabels($includerelations);
$labels['Name'] = _t('ChangeSet.NAME', 'Name');
$labels['State'] = _t('ChangeSet.STATE', 'State');
return $labels;
}
}