Standardize how external links are wrapped with Twig trans/endtrans tags in help topics

Created on 22 June 2023, about 1 year ago

Problem/Motivation

In πŸ“Œ Fix up minor copy problems in help topics Fixed we are standardizing how links to the Drupal User Guide in the Additional resources of many help topics are worded and displayed. In the process, I noticed how we are inconsistent with how we are wrapping these links with Twig {% trans %}{% endtrans %} tags, which are used to denote translation strings for localization. You can see the inconsistency here: https://localize.drupal.org/translate/languages/de/translate?project=dru...…]49123&search=User%20Guide&author&context=all&limit=10&sid=0

We should decide on a standard -- whether or not to include the anchor tag inside the {% trans %}{% endtrans %} tags. Then we should update the Help Topics Standard doc's code example with an example. Then we should update the help topics in accordance with the standard. This will affect existing translations, but hopefully won't be a major burden because we're just removing or adding HTML tags inside a translation string.

Steps to reproduce

Proposed resolution

I'm leaning toward not including HTML anchor tags <a></a> inside a Twig {% trans %}{% endtrans %} in a help topic. For example:

  <li><a href="https://www.drupal.org/docs/user_guide/en/structure-taxonomy-setup.html">{% trans %}Setting Up a Taxonomy (Drupal User Guide){% endtrans %}</a></li>

But there is at least 1 example outlier, where there is text following the link, and the link text and the following text should be translated in context with each other. For example:

    <li>{% trans %}<a href="https://www.drupal.org/docs/user_guide/en/security-chapter.html">Security and Maintenance (Drupal User Guide)</a>, which includes information on how to update your site's core software, modules, and themes.{% endtrans %}</li>

Remaining tasks

1. Decide on a course of action.
2. Update the Help Topics Standards code example.
3. Update the help topics.
4. Change record for translators.

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
HelpΒ  β†’

Last updated 25 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States Amber Himes Matz Portland, OR USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024