Needs work
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jul 2019 at 16:03 UTC
Updated:
1 Mar 2023 at 18:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
markhalliwellBetter title.
---
From: #2088371-40: YAML discovery incompatible with translations
---
This could easily be accomplished by implementing a YAML callback:
https://www.php.net/manual/en/yaml.callbacks.parse.php
For Symfony, we can essentially do the same but will have to iterate over the YAML array after parsing it to look for
\Symfony\Component\Yaml\Tag\TaggedValueobjects.Comment #3
markhalliwellhttps://symfony.com/blog/new-in-symfony-3-3-custom-yaml-tags#comment-21048
Turns out it, for BC reasons, tags don't work with string literals (yet).
So instead, we'd need need to wrap it in an array.
This is actually good because then we can just pass the entire contents of the array to the method which allows context :D
Also, I'm thinking the tag name should be
!translateas it reads better this way.Comment #4
markhalliwellInitial POC patch
Comment #6
markhalliwellComment #7
markhalliwellComment #8
markhalliwellComment #9
markhalliwellComment #10
markhalliwellComment #13
markhalliwellRandom test failure
Comment #14
markhalliwellPing
Comment #22
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #25
volegerRerolled against 10.1.x.
Comment #26
smustgrave commentedDidn't test but the MR has a test failure which seems valid.