Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Being perfectionist or write acceptable code for everybody?
We have loooooooooong sentences on Twig. And we don't know how to format it properly.
Background story: #1167366: Replace "Lorem Ipsum" Color preview HTML templates with example text in Twig templates
Proposed resolution
Pick the versions we will accept.
{# Align START & END tag, no link breaks #}
{% trans %}
A1. This is short sentence.
{% endtrans %}
{% trans %}
A2. This content is here to demonstrate what actual content would look like in the color scheme you configure. This is a block of example content.
{% endtrans %}
{# Align START & END tag, with link breaks #}
{% trans %}
B1. This is short sentence.
{% endtrans %}
{% trans %}
B2. This content is here to demonstrate what actual content would
look like in the color scheme you configure. This is a block of
example content.
{% endtrans %}
{# START & END tag without spaces #}
{% trans %}C1. This is short sentence.{% endtrans %}
{% trans %}C2. This content is here to demonstrate what actual content
would look like in the color scheme you configure. This is a block of
example content.{% endtrans %}
{# mixed version #}
{% trans %}D1. This is short sentence.{% endtrans %}
{% trans %}
D2. This content is here to demonstrate what actual content
would look like in the color scheme you configure. This is a block of
example content.
{% endtrans %}
{# link breaks and trans tag on each line #}
{% trans %}E1. This is short sentence.{% endtrans %}
{% trans %}E2. This content is here to demonstrate what{% endtrans %}
{% trans %}actual content would look like in the color{% endtrans %}
{% trans %}scheme you configure. This is a block of{% endtrans %}
{% trans %}example content.{% endtrans %}
Editor Visual:
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | editor.png | 108.18 KB | droplet |
Comments
Comment #2
droplet CreditAttribution: droplet commentedComment #3
droplet CreditAttribution: droplet commented