summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-08-26 05:06:04 (GMT)
committerwebchick2014-08-26 05:06:04 (GMT)
commita4b6e3b10fb6cba5063dfb14d43f2902ebcabf93 (patch)
tree3b8eae8dce3fdaf0ff01d1eb93e08c32e1b1f2c1
parent2b24e72116c6377aa3c39c113e95da8419262eb0 (diff)
Issue #2250841 by andypost, thechanceg, Buratino42 | vijaycs85: Fixed Adding a inline template for content translation status.
-rw-r--r--core/modules/content_translation/src/Controller/ContentTranslationController.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/modules/content_translation/src/Controller/ContentTranslationController.php b/core/modules/content_translation/src/Controller/ContentTranslationController.php
index b956422..5f2c460 100644
--- a/core/modules/content_translation/src/Controller/ContentTranslationController.php
+++ b/core/modules/content_translation/src/Controller/ContentTranslationController.php
@@ -147,9 +147,14 @@ class ContentTranslationController extends ControllerBase {
$links['edit']['title'] = $this->t('Edit');
}
$translation = $entity->translation[$langcode];
- $status = !empty($translation['status']) ? $this->t('Published') : $this->t('Not published');
- // @todo Remove as part of https://drupal.org/node/2250841.
- $status = '<span class="status">' . $status . '</span>' . (!empty($translation['outdated']) ? ' <span class="marker">' . $this->t('outdated') . '</span>' : '');
+ $status = array('data' => array(
+ '#type' => 'inline_template',
+ '#template' => '<span class="status">{% if status %}{{ "Published"|t }}{% else %}{{ "Not published"|t }}{% endif %}</span>{% if outdated %} <span class="marker">{{ "outdated"|t }}</span>{% endif %}',
+ '#context' => array(
+ 'status' => $translation['status'],
+ 'outdated' => $translation['outdated'],
+ ),
+ ));
if ($is_original) {
$language_name = $this->t('<strong>@language_name (Original language)</strong>', array('@language_name' => $language_name));