mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
l10n key to make "yes" and "no" translatable (see #1749)
This commit is contained in:
parent
a68fb1f096
commit
933fbf8ea4
@ -62,7 +62,7 @@ class CheckboxField_Readonly extends ReadonlyField {
|
||||
}
|
||||
|
||||
public function Value() {
|
||||
return Convert::raw2xml($this->value ? _t('CheckboxField.YES', 'Yes') : _t('CheckboxField.NO', 'No'));
|
||||
return Convert::raw2xml($this->value ? _t('CheckboxField.YESANSWER', 'Yes') : _t('CheckboxField.NOANSWER', 'No'));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -60,8 +60,8 @@ en:
|
||||
ERRORNOTREC: 'That username / password isn''t recognised'
|
||||
Boolean:
|
||||
ANY: Any
|
||||
NO: No
|
||||
YES: Yes
|
||||
NOANSWER: No
|
||||
YESANSWER: Yes
|
||||
CMSLoadingScreen.ss:
|
||||
LOADING: Loading...
|
||||
REQUIREJS: 'The CMS requires that you have JavaScript enabled.'
|
||||
@ -79,8 +79,8 @@ en:
|
||||
HELLO: Hi
|
||||
PASSWORD: Password
|
||||
CheckboxField:
|
||||
NO: No
|
||||
YES: Yes
|
||||
NOANSWER: No
|
||||
YESANSWER: Yes
|
||||
ComplexTableField:
|
||||
CLOSEPOPUP: 'Close Popup'
|
||||
SUCCESSADD2: 'Added {name}'
|
||||
|
@ -27,7 +27,7 @@ class Boolean extends DBField {
|
||||
}
|
||||
|
||||
public function Nice() {
|
||||
return ($this->value) ? _t('Boolean.YES', 'Yes') : _t('Boolean.NO', 'No');
|
||||
return ($this->value) ? _t('Boolean.YESANSWER', 'Yes') : _t('Boolean.NOANSWER', 'No');
|
||||
}
|
||||
|
||||
public function NiceAsBoolean() {
|
||||
@ -53,8 +53,8 @@ class Boolean extends DBField {
|
||||
public function scaffoldSearchField($title = null) {
|
||||
$anyText = _t('Boolean.ANY', 'Any');
|
||||
$source = array(
|
||||
1 => _t('Boolean.YES', 'Yes'),
|
||||
0 => _t('Boolean.NO', 'No')
|
||||
1 => _t('Boolean.YESANSWER', 'Yes'),
|
||||
0 => _t('Boolean.NOANSWER', 'No')
|
||||
);
|
||||
|
||||
$field = new DropdownField($this->name, $title, $source);
|
||||
|
@ -122,18 +122,18 @@ class CheckboxFieldTest extends SapphireTest {
|
||||
// Test 1: a checked checkbox goes to "Yes"
|
||||
$field1 = new CheckboxField('IsChecked', 'Checked');
|
||||
$field1->setValue('on');
|
||||
$this->assertEquals(_t('CheckboxField.YES', 'Yes'),
|
||||
$this->assertEquals(_t('CheckboxField.YESANSWER', 'Yes'),
|
||||
trim(strip_tags($field1->performReadonlyTransformation()->Field())));
|
||||
|
||||
// Test 2: an checkbox with the value set to false to "No"
|
||||
$field2 = new CheckboxField('IsChecked', 'Checked');
|
||||
$field2->setValue(false);
|
||||
$this->assertEquals(_t('CheckboxField.NO', 'No'),
|
||||
$this->assertEquals(_t('CheckboxField.NOANSWER', 'No'),
|
||||
trim(strip_tags($field2->performReadonlyTransformation()->Field())));
|
||||
|
||||
// Test 3: an checkbox with no value ever set goes to "No"
|
||||
$field3 = new CheckboxField('IsChecked', 'Checked');
|
||||
$this->assertEquals(_t('CheckboxField.NO', 'No'),
|
||||
$this->assertEquals(_t('CheckboxField.NOANSWER', 'No'),
|
||||
trim(strip_tags($field3->performReadonlyTransformation()->Field())));
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user