summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2015-04-20 10:42:01 (GMT)
committerxjm2015-04-20 10:42:01 (GMT)
commit76ca5b08cc2fd1f5210ffe0cf62f1af5f94fa5e7 (patch)
tree0ddf1eb48dd4c1dd29c96c36530e42015dd86e07
parenta9f9c0316dc45709b6504e04af9de1460eaae252 (diff)
Issue #2073075 by vanilla-bear, joshi.rohit100, swentel, marcingy, er.pushpinderrana, ACF, roderik: Don't call the t() function in OO code in the field_ui module
-rw-r--r--core/modules/field_ui/src/EntityDisplayModeListBuilder.php4
-rw-r--r--core/modules/field_ui/src/FieldStorageConfigListBuilder.php10
-rw-r--r--core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php2
-rw-r--r--core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php6
4 files changed, 11 insertions, 11 deletions
diff --git a/core/modules/field_ui/src/EntityDisplayModeListBuilder.php b/core/modules/field_ui/src/EntityDisplayModeListBuilder.php
index f17a076..906a8e0 100644
--- a/core/modules/field_ui/src/EntityDisplayModeListBuilder.php
+++ b/core/modules/field_ui/src/EntityDisplayModeListBuilder.php
@@ -60,7 +60,7 @@ class EntityDisplayModeListBuilder extends ConfigEntityListBuilder {
* {@inheritdoc}
*/
public function buildHeader() {
- $header['label'] = t('Name');
+ $header['label'] = $this->t('Name');
return $header + parent::buildHeader();
}
@@ -120,7 +120,7 @@ class EntityDisplayModeListBuilder extends ConfigEntityListBuilder {
'data' => array(
'#type' => 'link',
'#url' => Url::fromRoute($short_type == 'view' ? 'entity.entity_view_mode.add_form' : 'entity.entity_form_mode.add_form', ['entity_type_id' => $entity_type]),
- '#title' => t('Add new %label @entity-type', array('%label' => $this->entityTypes[$entity_type]->getLabel(), '@entity-type' => $this->entityType->getLowercaseLabel())),
+ '#title' => $this->t('Add new %label @entity-type', array('%label' => $this->entityTypes[$entity_type]->getLabel(), '@entity-type' => $this->entityType->getLowercaseLabel())),
),
'colspan' => count($table['#header']),
);
diff --git a/core/modules/field_ui/src/FieldStorageConfigListBuilder.php b/core/modules/field_ui/src/FieldStorageConfigListBuilder.php
index d0fe42f..6e74442 100644
--- a/core/modules/field_ui/src/FieldStorageConfigListBuilder.php
+++ b/core/modules/field_ui/src/FieldStorageConfigListBuilder.php
@@ -85,12 +85,12 @@ class FieldStorageConfigListBuilder extends ConfigEntityListBuilder {
* {@inheritdoc}
*/
public function buildHeader() {
- $header['id'] = t('Field name');
+ $header['id'] = $this->t('Field name');
$header['type'] = array(
- 'data' => t('Field type'),
+ 'data' => $this->t('Field type'),
'class' => array(RESPONSIVE_PRIORITY_MEDIUM),
);
- $header['usage'] = t('Used in');
+ $header['usage'] = $this->t('Used in');
return $header;
}
@@ -100,14 +100,14 @@ class FieldStorageConfigListBuilder extends ConfigEntityListBuilder {
public function buildRow(EntityInterface $field_storage) {
if ($field_storage->isLocked()) {
$row['class'] = array('menu-disabled');
- $row['data']['id'] = t('@field_name (Locked)', array('@field_name' => $field_storage->getName()));
+ $row['data']['id'] = $this->t('@field_name (Locked)', array('@field_name' => $field_storage->getName()));
}
else {
$row['data']['id'] = $field_storage->getName();
}
$field_type = $this->fieldTypes[$field_storage->getType()];
- $row['data']['type'] = t('@type (module: @module)', array('@type' => $field_type['label'], '@module' => $field_type['provider']));
+ $row['data']['type'] = $this->t('@type (module: @module)', array('@type' => $field_type['label'], '@module' => $field_type['provider']));
$usage = array();
foreach ($field_storage->getBundles() as $bundle) {
diff --git a/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php b/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php
index f244163..0d0447b 100644
--- a/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php
+++ b/core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php
@@ -19,7 +19,7 @@ class EntityDisplayModeDeleteForm extends EntityDeleteForm {
*/
public function getDescription() {
$entity_type = $this->entity->getEntityType();
- return t('Deleting a @entity-type will cause any output still requesting to use that @entity-type to use the default display settings.', array('@entity-type' => $entity_type->getLowercaseLabel()));
+ return $this->t('Deleting a @entity-type will cause any output still requesting to use that @entity-type to use the default display settings.', array('@entity-type' => $entity_type->getLowercaseLabel()));
}
}
diff --git a/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php
index 0bdce49..7d79bd7 100644
--- a/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php
+++ b/core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php
@@ -76,14 +76,14 @@ abstract class EntityDisplayModeFormBase extends EntityForm {
public function form(array $form, FormStateInterface $form_state) {
$form['label'] = array(
'#type' => 'textfield',
- '#title' => t('Name'),
+ '#title' => $this->t('Name'),
'#maxlength' => 100,
'#default_value' => $this->entity->label(),
);
$form['id'] = array(
'#type' => 'machine_name',
- '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'),
+ '#description' => $this->t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'),
'#disabled' => !$this->entity->isNew(),
'#default_value' => $this->entity->id(),
'#field_prefix' => $this->entity->isNew() ? $this->entity->getTargetType() . '.' : '',
@@ -122,7 +122,7 @@ abstract class EntityDisplayModeFormBase extends EntityForm {
* {@inheritdoc}
*/
public function save(array $form, FormStateInterface $form_state) {
- drupal_set_message(t('Saved the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $this->entityType->getLowercaseLabel())));
+ drupal_set_message($this->t('Saved the %label @entity-type.', array('%label' => $this->entity->label(), '@entity-type' => $this->entityType->getLowercaseLabel())));
$this->entity->save();
\Drupal::entityManager()->clearCachedFieldDefinitions();
$form_state->setRedirectUrl($this->entity->urlInfo('collection'));