0

Why would placeholders not be replaced?

For example, in the Uninstall page for modules, it shows the following.

screenshot

It happens under the revisions tab as well.

screenshot

  • 2
    I don’t think this is Twig related? – Kevin Dec 14 '18 at 23:56
  • 1
    Looks like the t() function in your Drupal is not replacing the placeholder values for some reason. – No Sssweat Dec 15 '18 at 4:25
  • 1
    Apparently the cause is the [github.com/drupal-pattern-lab/unified-twig-extensions/blob/… unified twig extensions module. Still not sure how it is messing the t() function up exactly. – electrokate Dec 16 '18 at 16:48
  • 1
    My guess is it might come with a dummy function that mocks t() and returns it for theming purposes? It could be overriding. – Kevin Dec 17 '18 at 4:12
  • @Kevin you were right, thank you for this insight! – electrokate Dec 18 '18 at 20:30
0

It looks like electrokate installed a Pattern Lab starter theme for Drupal that has a mock of the t() function that acts as a placeholder for prototyping the front end layer. It only returns the input it was sent, so it "works" under Pattern Lab - but running it inside of Drupal will cause this issue.

/**
 * @file
 * Drupal translate filter.
 */
$filter = new Twig_SimpleFilter('t', function ($string) {
  return $string;
});

This is meant to aid in making a Pattern Lab prototype outside of Drupal, but taking advantage of functions you will expect to use inside of Drupal so it is "Drupal ready".

edit: I may have linked to the wrong starter theme, but I can’t navigate it on mobile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.