You are here

lingotek-target-statuses.html.twig in Lingotek Translation 3.3.x

Default theme implementation of the Lingotek target statuses.

Available variables:

  • entity: The entity which status we want to display.
  • source_langcode: The language code.
  • statuses: The source statuses, keyed by language code. The keys are:
    • status: The status for that translation.
    • url: An optional \Drupal\Core\Url object.
    • new_window: A flag indicating if the link should be opened in a new window.
    • status_text: The status text, mainly though for link title.
    • language: The language code.

File

templates/lingotek-target-statuses.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of the Lingotek target statuses.
  5. *
  6. * Available variables:
  7. * - entity: The entity which status we want to display.
  8. * - source_langcode: The language code.
  9. * - statuses: The source statuses, keyed by language code. The keys are:
  10. * - status: The status for that translation.
  11. * - url: An optional \Drupal\Core\Url object.
  12. * - new_window: A flag indicating if the link should be opened in a new window.
  13. * - status_text: The status text, mainly though for link title.
  14. * - language: The language code.
  15. *
  16. * @see template_preprocess()
  17. * @see template_preprocess_lingotek_target_statuses()
  18. *
  19. * @ingroup themeable
  20. */
  21. #}
  22. {% for status in statuses %}{% if status.url %}<a href="{{ status.url }}"{%if status.new_window%} target="_blank"{%endif%}{%else%}<span{%endif%} class="language-icon target-{{status.status|lower}}" title="{{status.status_text}}">{{status.language|upper}}{%if status.url%}</a>{%else%}</span>{%endif%}{% endfor %}