You are here

i18n.html.twig in Bamboo Twig 8.4

<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
  1. <div class="test-i18n">
  2. <!-- Curent Langauge -->
  3. <h2>Curent Langauge</h2>
  4. <hr>
  5. <div class="i18n-current-lang">
  6. {{ bamboo_i18n_current_lang() }}
  7. </div>
  8. <!-- Format Date -->
  9. <h2>Format Date</h2>
  10. <hr>
  11. <div class="i18n-format-date-string">
  12. {{ '24-07-2014 17:33:03'|bamboo_i18n_format_date('custom', 'l dS F Y') }}
  13. </div>
  14. <div class="i18n-format-date-timestamp">
  15. {{ 1406187183|bamboo_i18n_format_date('custom', 'l dS F Y') }}
  16. </div>
  17. <div class="i18n-format-date-datetime">
  18. {{ variables.datetime|bamboo_i18n_format_date('custom', 'l dS F Y') }}
  19. </div>
  20. <div class="i18n-format-date-datetimeplus">
  21. {{ variables.datetimeplus|bamboo_i18n_format_date('custom', 'l dS F Y') }}
  22. </div>
  23. <div class="i18n-format-date-drupaldatetime">
  24. {{ variables.drupaldatetime|bamboo_i18n_format_date('custom', 'l dS F Y') }}
  25. </div>
  26. <div class="i18n-format-date-datetime-medium">
  27. {{ variables.datetime|bamboo_i18n_format_date() }}
  28. </div>
  29. <!-- Get Translation -->
  30. <h2>Get Translation</h2>
  31. <hr>
  32. <div class="i18n-get-translation-node-1-ru">
  33. {{ variables.articles[0]|bamboo_i18n_get_translation('ru').title.value }}
  34. </div>
  35. <div class="i18n-get-translation-node-1">
  36. {{ variables.articles[0]|bamboo_i18n_get_translation().title.value }}
  37. </div>
  38. <div class="i18n-get-translation-node-1-en">
  39. {{ variables.articles[0]|bamboo_i18n_get_translation('en').title.value }}
  40. </div>
  41. <div class="i18n-get-translation-node-1-fr">
  42. {{ variables.articles[0]|bamboo_i18n_get_translation('fr').title.value }}
  43. </div>
  44. <div class="i18n-get-translation-node-1-de">
  45. {{ variables.articles[0]|bamboo_i18n_get_translation('de').title.value }}
  46. </div>
  47. <div class="i18n-get-translation-node-2">
  48. {{ variables.articles[1]|bamboo_i18n_get_translation().title.value }}
  49. </div>
  50. <div class="i18n-get-translation-node-2-en">
  51. {{ variables.articles[1]|bamboo_i18n_get_translation('en').title.value }}
  52. </div>
  53. <div class="i18n-get-translation-node-2-fr">
  54. {{ variables.articles[1]|bamboo_i18n_get_translation('fr').title.value }}
  55. </div>
  56. <div class="i18n-get-translation-node-2-de">
  57. {{ variables.articles[1]|bamboo_i18n_get_translation('de').title.value }}
  58. </div>
  59. <div class="i18n-get-translation-node-3">
  60. {{ variables.articles[2]|bamboo_i18n_get_translation().title.value }}
  61. </div>
  62. <div class="i18n-get-translation-node-3-en">
  63. {{ variables.articles[2]|bamboo_i18n_get_translation('en').title.value }}
  64. </div>
  65. <div class="i18n-get-translation-node-3-fr">
  66. {{ variables.articles[2]|bamboo_i18n_get_translation('fr').title.value }}
  67. </div>
  68. <div class="i18n-get-translation-node-3-de">
  69. {{ variables.articles[2]|bamboo_i18n_get_translation('de').title.value }}
  70. </div>
  71. <!-- Referenced field -->
  72. <h2>Referenced field</h2>
  73. <hr>
  74. <div class="loader-entity-reference-field-1">
  75. {{ variables.articles[0].field_tags.entity|bamboo_i18n_get_translation.name.value }}
  76. </div>
  77. <div class="loader-entity-reference-field-2">
  78. {{ variables.articles[1].field_tags.entity|bamboo_i18n_get_translation.name.value }}
  79. </div>
  80. <div class="loader-entity-reference-field-3">
  81. {{ variables.articles[2].field_tags.entity|bamboo_i18n_get_translation.name.value }}
  82. </div>
  83. <div class="loader-entity-reference-field-4">
  84. {{ variables.articles[3].field_tags.entity|bamboo_i18n_get_translation.name.value }}
  85. </div>
  86. <div class="loader-entity-reference-field-5">
  87. {{ variables.articles[4].field_tags.entity|bamboo_i18n_get_translation.name.value }}
  88. </div>
  89. </div>