/** * Transform a translatable CheckboxField to show the field value from the default language * in the label. * * @param FormField $nonEditableField The readonly field to contain the original value * @param FormField $originalField The original editable field containing the translated value * @return CheckboxField The field with a modified label */ protected function transformCheckboxField(CheckboxField $nonEditableField, CheckboxField $originalField) { $label = $originalField->Title(); $fieldName = $originalField->getName(); $value = $this->original->{$fieldName} ? _t('Translatable_Transform.CheckboxValueYes', 'Yes') : _t('Translatable_Transform.CheckboxValueNo', 'No'); $originalLabel = _t('Translatable_Transform.OriginalCheckboxLabel', 'Original: {value}', 'Addition to a checkbox field label showing the original value of the translatable field.', array('value' => $value)); $originalField->setTitle($label . ' <span class="originalvalue">(' . $originalLabel . ')</span>'); return $originalField; }