Problem/Motivation

Before #2565895: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols, each string placeholder had an equivalent in Twig. So if you wanted to say {% trans %}Hello {{ username|placeholder }}{% trans %} this would end up as t('Hello %username') (instead of the default t('Hello @username'). The :placeholder type added by #2565895: Add a new :placeholder to SafeMarkup::format() for URLs that handles bad protocols however did not get any Twig updates, so it is not possible to use from there.

Proposed resolution

Let's not leave Twig behind. Figure out the best way to name that "filter" and apply that. Proposed "url" for now.

Remaining tasks

Review.

User interface changes

None.

API changes

Twig up to par again with t() and not a second class citizen. Adding a new "filter" to trans tags.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy created an issue. See original summary.

Gábor Hojtsy’s picture

Status: Active » Needs review
FileSize
2.55 KB
Gábor Hojtsy’s picture

star-szr’s picture

@Gábor Hojtsy thanks, seems like a possible duplicate of #2575275: {% trans %} (and other parts of templates) are unable to use URL escaping though…

Gábor Hojtsy’s picture

Status: Needs review » Closed (duplicate)
Issue tags: -sprint, -rc target triage

Duplicate of #2575275: {% trans %} (and other parts of templates) are unable to use URL escaping then. Made some significant metadata updates there, so its not hidden so well :P

Status: Closed (duplicate) » Needs work

The last submitted patch, 2: 2592573.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Closed (duplicate)