diff -u b/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php --- b/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Controller/ContentTranslationController.php @@ -34,7 +34,7 @@ $rel[$name] = $entity->getSystemPath($name); } - $header = array(t('Language'), t('Translation'), t('Source language'), t('Status'), t('Operations')); + $header = array($this->t('Language'), $this->t('Translation'), $this->t('Source language'), $this->t('Status'), t('Operations')); $rows = array(); if ($this->languageManager()->isMultilingual()) { @@ -76,12 +76,13 @@ $row_title = l($label, $link['href'], $link); if (empty($link['href'])) { - $row_title = $is_original ? $label : t('n/a'); + $row_title = $is_original ? $label : $this->t('n/a'); } - // If the user is allowed to edit the entity we point the edit link to - // the entity form, otherwise if we are not dealing with the original - // language we point the link to the translation form. + // If the user is allowed to edit the entity we point the + // edit link to the entity form, otherwise if we are not + // dealing with the original language we point the link + // to the translation form. if ($entity->access('update')) { $links['edit'] = isset($edit_links->links[$langcode]['href']) ? $edit_links->links[$langcode] : array('href' => $rel['edit-form'], 'language' => $language); } @@ -90,49 +91,49 @@ } if (isset($links['edit'])) { - $links['edit']['title'] = t('Edit'); + $links['edit']['title'] = $this->t('Edit'); } $translation = $entity->translation[$langcode]; - $status = !empty($translation['status']) ? t('Published') : t('Not published'); + $status = !empty($translation['status']) ? $this->t('Published') : $this->t('Not published'); // @todo Add a theming function here. - $status = '' . $status . '' . (!empty($translation['outdated']) ? ' ' . t('outdated') . '' : ''); + $status = '' . $status . '' . (!empty($translation['outdated']) ? ' ' . $this->t('outdated') . '' : ''); if ($is_original) { - $language_name = t('@language_name (Original language)', array('@language_name' => $language_name)); - $source_name = t('n/a'); + $language_name = $this->t('@language_name (Original language)', array('@language_name' => $language_name)); + $source_name = $this->t('n/a'); } else { - $source_name = isset($languages[$source]) ? $languages[$source]->name : t('n/a'); + $source_name = isset($languages[$source]) ? $languages[$source]->name : $this->t('n/a'); if ($controller->getTranslationAccess($entity, 'delete')) { $links['delete'] = isset($delete_links->links[$langcode]['href']) ? $delete_links->links[$langcode] : array('href' => $delete_links, 'language' => $language); - $links['delete']['title'] = t('Delete'); + $links['delete']['title'] = $this->t('Delete'); } } } else { // No such translation in the set yet: help user to create it. - $row_title = $source_name = t('n/a'); + $row_title = $source_name = $this->t('n/a'); $source = $entity->language()->id; if ($source != $langcode && $controller->getTranslationAccess($entity, 'create')) { if ($translatable) { $links['add'] = isset($add_links->links[$langcode]['href']) ? $add_links->links[$langcode] : array('href' => $add_path, 'language' => $language); - $links['add']['title'] = t('Add'); + $links['add']['title'] = $this->t('Add'); } elseif ($administrator) { - $links['nofields'] = array('title' => t('No translatable fields'), 'route_name' => 'language.content_settings_page', 'language' => $language); + $links['nofields'] = array('title' => $this->t('No translatable fields'), 'route_name' => 'language.content_settings_page', 'language' => $language); } } - $status = t('Not translated'); + $status = $this->t('Not translated'); } $rows[] = array($language_name, $row_title, $source_name, $status, $operations); } } - $build['#title'] = t('Translations of %label', array('%label' => $entity->label())); + $build['#title'] = $this->t('Translations of %label', array('%label' => $entity->label())); // Add metadata to the build render array to let other modules know about // which entity this is.