@@ -54,13 +68,13 @@ public function __construct(EntityManager $entity_manager, PluginManagerBase $pl
publicfunctiongetRegions(){
returnarray(
'content'=>array(
'title'=>t('Content'),
'title'=>$this->t('Content'),
'invisible'=>TRUE,
'message'=>t('No field is displayed.')
'message'=>$this->t('No field is displayed.')
),
'hidden'=>array(
'title'=>t('Disabled'),
'message'=>t('No field is hidden.')
'title'=>$this->t('Disabled'),
'message'=>$this->t('No field is hidden.')
),
);
}
...
...
@@ -91,7 +105,7 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL,
);
if(empty($instances)&&empty($extra_fields)){
drupal_set_message(t('There are no fields yet added. You can add new fields on the <a href="@link">Manage fields</a> page.',array('@link'=>url($this->adminPath.'/fields'))),'warning');
drupal_set_message($this->t('There are no fields yet added. You can add new fields on the <a href="@link">Manage fields</a> page.',array('@link'=>url($this->adminPath.'/fields'))),'warning');
return$form;
}
...
...
@@ -128,7 +142,7 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL,
if($display_modes=$this->getDisplayModes()){
$form['modes']=array(
'#type'=>'details',
'#title'=>t('Custom display settings'),
'#title'=>$this->t('Custom display settings'),
'#collapsed'=>TRUE,
);
// Collect options and default values for the 'Custom display settings'
...
...
@@ -144,7 +158,7 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL,
}
$form['modes']['display_modes_custom']=array(
'#type'=>'checkboxes',
'#title'=>t('Use custom display settings for the following modes'),
'#title'=>$this->t('Use custom display settings for the following modes'),
'#options'=>$options,
'#default_value'=>$default,
);
...
...
@@ -160,7 +174,7 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL,
$form['refresh_rows']=array('#type'=>'hidden');
$form['refresh']=array(
'#type'=>'submit',
'#value'=>t('Refresh'),
'#value'=>$this->t('Refresh'),
'#op'=>'refresh_table',
'#submit'=>array(array($this,'multistepSubmit')),
'#ajax'=>array(
...
...
@@ -175,7 +189,7 @@ public function buildForm(array $form, array &$form_state, $entity_type = NULL,
drupal_set_message(t('The %display_mode mode now uses custom display settings. You might want to <a href="@url">configure them</a>.',array('%display_mode'=>$display_mode_label,'@url'=>url($path))));
drupal_set_message($this->t('The %display_mode mode now uses custom display settings. You might want to <a href="@url">configure them</a>.',array('%display_mode'=>$display_mode_label,'@url'=>url($path))));
drupal_set_message(t('There was a problem creating field %label: !message',array('%label'=>$instance['label'],'!message'=>$e->getMessage())),'error');
drupal_set_message($this->t('There was a problem creating field %label: !message',array('%label'=>$instance['label'],'!message'=>$e->getMessage())),'error');
}
}
...
...
@@ -431,7 +431,7 @@ public function submitForm(array &$form, array &$form_state) {
$values=$form_values['_add_existing_field'];
$field=field_info_field($values['field_name']);
if(!empty($field['locked'])){
drupal_set_message(t('The field %label cannot be added because it is locked.',array('%label'=>$values['label'])),'error');
drupal_set_message($this->t('The field %label cannot be added because it is locked.',array('%label'=>$values['label'])),'error');
}
else{
$instance=array(
...
...
@@ -464,7 +464,7 @@ public function submitForm(array &$form, array &$form_state) {
drupal_set_message(t('There was a problem creating field instance %label: @message.',array('%label'=>$instance['label'],'@message'=>$e->getMessage())),'error');
drupal_set_message($this->t('There was a problem creating field instance %label: @message.',array('%label'=>$instance['label'],'@message'=>$e->getMessage())),'error');
}
}
}
...
...
@@ -479,7 +479,7 @@ public function submitForm(array &$form, array &$form_state) {
@@ -46,14 +46,14 @@ public static function create(ContainerInterface $container) {
* {@inheritdoc}
*/
publicfunctiongetQuestion(){
returnt('Are you sure you want to delete the field %field?',array('%field'=>$this->entity->label()));
return$this->t('Are you sure you want to delete the field %field?',array('%field'=>$this->entity->label()));
}
/**
* {@inheritdoc}
*/
publicfunctiongetConfirmText(){
returnt('Delete');
return$this->t('Delete');
}
/**
...
...
@@ -73,10 +73,10 @@ public function submit(array $form, array &$form_state) {
if($field&&!$field['locked']){
$this->entity->delete();
drupal_set_message(t('The field %field has been deleted from the %type content type.',array('%field'=>$this->entity->label(),'%type'=>$bundle_label)));
drupal_set_message($this->t('The field %field has been deleted from the %type content type.',array('%field'=>$this->entity->label(),'%type'=>$bundle_label)));
}
else{
drupal_set_message(t('There was a problem removing the %field from the %type content type.',array('%field'=>$this->entity->label(),'%type'=>$bundle_label)),'error');
drupal_set_message($this->t('There was a problem removing the %field from the %type content type.',array('%field'=>$this->entity->label(),'%type'=>$bundle_label)),'error');