{% trans %}<span class="by-author">by {{ author_name }}</span> {{ created_date }}{% endtrans %}
It gives the following error when importing translations.
Import of string "<span class = "by-author">@author_name </span> от @created_date" was skipped because of disallowed or malformed HTML.
Comments
Comment #2
jungleMaybe it's relevant
Comment #3
jungleSame twig markup exists in both core/profiles/demo_umami/themes/umami/templates/content/node--article--full.html.twig and core/profiles/demo_umami/themes/umami/templates/content/node.html.twig.
Comment #4
markconroy commentedHi @Chi and @jungle
Thanks for reporting this issue; it looks very interesting. Can you provide steps to reproduce this? I presume it's when you use the UI to add a new language?
I wonder is the issue because of the custom
{{ created_date }}variable that we created, rather than using{{ date }}like in the other node.html.twig templates? Perhaps it has something to do with that being defined within the node* templates in Umami rather than being done in a preprocess function somewhere else. I'm not sure, that's just a hunch.Comment #5
chi commentedThe error occurs because of spaces in class attribute. I've just downloaded the translation file again and it does not contain these spaces. Not sure how I got them initially.
Comment #6
chi commentedHowever I think having CSS classes inside translatable string is not a good idea. But that's a different issue.
Comment #7
markconroy commentedThanks for checking back on that for us @Chi. We appreciate it.