i18n.html.twig in Bamboo Twig 8.5
<div class="test-i18n">
<!-- Curent Langauge -->
<h2>Curent Langauge</h2>
<hr>
<div class="i18n-current-lang">
{{ bamboo_i18n_current_lang() }}
</div>
<!-- Format Date -->
<h2>Format Date</h2>
<hr>
<div class="i18n-format-date-string">
{{ '24-07-2014 17:33:03'|bamboo_i18n_format_date('custom', 'l dS F Y') }}
</div>
<div class="i18n-format-date-timestamp">
{{ 1406187183|bamboo_i18n_format_date('custom', 'l dS F Y') }}
</div>
<div class="i18n-format-date-datetime">
{{ variables.datetime|bamboo_i18n_format_date('custom', 'l dS F Y') }}
</div>
<div class="i18n-format-date-datetimeplus">
{{ variables.datetimeplus|bamboo_i18n_format_date('custom', 'l dS F Y') }}
</div>
<div class="i18n-format-date-drupaldatetime">
{{ variables.drupaldatetime|bamboo_i18n_format_date('custom', 'l dS F Y') }}
</div>
<div class="i18n-format-date-datetime-medium">
{{ variables.datetime|bamboo_i18n_format_date() }}
</div>
<!-- Get Translation -->
<h2>Get Translation</h2>
<hr>
<div class="i18n-get-translation-node-1-ru">
{{ variables.articles[0]|bamboo_i18n_get_translation('ru').title.value }}
</div>
<div class="i18n-get-translation-node-1">
{{ variables.articles[0]|bamboo_i18n_get_translation().title.value }}
</div>
<div class="i18n-get-translation-node-1-en">
{{ variables.articles[0]|bamboo_i18n_get_translation('en').title.value }}
</div>
<div class="i18n-get-translation-node-1-fr">
{{ variables.articles[0]|bamboo_i18n_get_translation('fr').title.value }}
</div>
<div class="i18n-get-translation-node-1-de">
{{ variables.articles[0]|bamboo_i18n_get_translation('de').title.value }}
</div>
<div class="i18n-get-translation-node-2">
{{ variables.articles[1]|bamboo_i18n_get_translation().title.value }}
</div>
<div class="i18n-get-translation-node-2-en">
{{ variables.articles[1]|bamboo_i18n_get_translation('en').title.value }}
</div>
<div class="i18n-get-translation-node-2-fr">
{{ variables.articles[1]|bamboo_i18n_get_translation('fr').title.value }}
</div>
<div class="i18n-get-translation-node-2-de">
{{ variables.articles[1]|bamboo_i18n_get_translation('de').title.value }}
</div>
<div class="i18n-get-translation-node-3">
{{ variables.articles[2]|bamboo_i18n_get_translation().title.value }}
</div>
<div class="i18n-get-translation-node-3-en">
{{ variables.articles[2]|bamboo_i18n_get_translation('en').title.value }}
</div>
<div class="i18n-get-translation-node-3-fr">
{{ variables.articles[2]|bamboo_i18n_get_translation('fr').title.value }}
</div>
<div class="i18n-get-translation-node-3-de">
{{ variables.articles[2]|bamboo_i18n_get_translation('de').title.value }}
</div>
<!-- Referenced field -->
<h2>Referenced field</h2>
<hr>
<div class="loader-entity-reference-field-1">
{{ variables.articles[0].field_tags.entity|bamboo_i18n_get_translation.name.value }}
</div>
<div class="loader-entity-reference-field-2">
{{ variables.articles[1].field_tags.entity|bamboo_i18n_get_translation.name.value }}
</div>
<div class="loader-entity-reference-field-3">
{{ variables.articles[2].field_tags.entity|bamboo_i18n_get_translation.name.value }}
</div>
<div class="loader-entity-reference-field-4">
{{ variables.articles[3].field_tags.entity|bamboo_i18n_get_translation.name.value }}
</div>
<div class="loader-entity-reference-field-5">
{{ variables.articles[4].field_tags.entity|bamboo_i18n_get_translation.name.value }}
</div>
</div>
File
tests/modules/bamboo_twig_test/templates/i18n.html.twig
View source
- <div class="test-i18n">
- <!-- Curent Langauge -->
- <h2>Curent Langauge</h2>
- <hr>
- <div class="i18n-current-lang">
- {{ bamboo_i18n_current_lang() }}
- </div>
-
- <!-- Format Date -->
- <h2>Format Date</h2>
- <hr>
- <div class="i18n-format-date-string">
- {{ '24-07-2014 17:33:03'|bamboo_i18n_format_date('custom', 'l dS F Y') }}
- </div>
- <div class="i18n-format-date-timestamp">
- {{ 1406187183|bamboo_i18n_format_date('custom', 'l dS F Y') }}
- </div>
- <div class="i18n-format-date-datetime">
- {{ variables.datetime|bamboo_i18n_format_date('custom', 'l dS F Y') }}
- </div>
- <div class="i18n-format-date-datetimeplus">
- {{ variables.datetimeplus|bamboo_i18n_format_date('custom', 'l dS F Y') }}
- </div>
- <div class="i18n-format-date-drupaldatetime">
- {{ variables.drupaldatetime|bamboo_i18n_format_date('custom', 'l dS F Y') }}
- </div>
- <div class="i18n-format-date-datetime-medium">
- {{ variables.datetime|bamboo_i18n_format_date() }}
- </div>
-
- <!-- Get Translation -->
- <h2>Get Translation</h2>
- <hr>
- <div class="i18n-get-translation-node-1-ru">
- {{ variables.articles[0]|bamboo_i18n_get_translation('ru').title.value }}
- </div>
-
- <div class="i18n-get-translation-node-1">
- {{ variables.articles[0]|bamboo_i18n_get_translation().title.value }}
- </div>
- <div class="i18n-get-translation-node-1-en">
- {{ variables.articles[0]|bamboo_i18n_get_translation('en').title.value }}
- </div>
- <div class="i18n-get-translation-node-1-fr">
- {{ variables.articles[0]|bamboo_i18n_get_translation('fr').title.value }}
- </div>
- <div class="i18n-get-translation-node-1-de">
- {{ variables.articles[0]|bamboo_i18n_get_translation('de').title.value }}
- </div>
-
- <div class="i18n-get-translation-node-2">
- {{ variables.articles[1]|bamboo_i18n_get_translation().title.value }}
- </div>
- <div class="i18n-get-translation-node-2-en">
- {{ variables.articles[1]|bamboo_i18n_get_translation('en').title.value }}
- </div>
- <div class="i18n-get-translation-node-2-fr">
- {{ variables.articles[1]|bamboo_i18n_get_translation('fr').title.value }}
- </div>
- <div class="i18n-get-translation-node-2-de">
- {{ variables.articles[1]|bamboo_i18n_get_translation('de').title.value }}
- </div>
-
- <div class="i18n-get-translation-node-3">
- {{ variables.articles[2]|bamboo_i18n_get_translation().title.value }}
- </div>
- <div class="i18n-get-translation-node-3-en">
- {{ variables.articles[2]|bamboo_i18n_get_translation('en').title.value }}
- </div>
- <div class="i18n-get-translation-node-3-fr">
- {{ variables.articles[2]|bamboo_i18n_get_translation('fr').title.value }}
- </div>
- <div class="i18n-get-translation-node-3-de">
- {{ variables.articles[2]|bamboo_i18n_get_translation('de').title.value }}
- </div>
-
- <!-- Referenced field -->
- <h2>Referenced field</h2>
- <hr>
- <div class="loader-entity-reference-field-1">
- {{ variables.articles[0].field_tags.entity|bamboo_i18n_get_translation.name.value }}
- </div>
- <div class="loader-entity-reference-field-2">
- {{ variables.articles[1].field_tags.entity|bamboo_i18n_get_translation.name.value }}
- </div>
- <div class="loader-entity-reference-field-3">
- {{ variables.articles[2].field_tags.entity|bamboo_i18n_get_translation.name.value }}
- </div>
- <div class="loader-entity-reference-field-4">
- {{ variables.articles[3].field_tags.entity|bamboo_i18n_get_translation.name.value }}
- </div>
- <div class="loader-entity-reference-field-5">
- {{ variables.articles[4].field_tags.entity|bamboo_i18n_get_translation.name.value }}
- </div>
- </div>