Skip to content

The HTML within a paragraph gets converted into a translation string on theme save #573

@pshemek

Description

@pshemek

I ended up with:

<!-- wp:paragraph {"style":{"typography":{"fontStyle":"normal","fontWeight":"500"}}} -->
<p style="font-style:normal;font-weight:500">
<?php echo __('<a href="mailto:email@example.com" data-type="mailto" data-id="mailto:email@example.com">email@example.com</a><br>Tel.: +48 000 000 000', 'mytheme');?>
</p>
<!-- /wp:paragraph -->

while the more desirable would be:

<!-- wp:paragraph {"style":{"typography":{"fontStyle":"normal","fontWeight":"500"}}} -->
<p style="font-style:normal;font-weight:500">
<a href="mailto:email@example.com" data-type="mailto" data-id="mailto:email@example.com"><?php echo __('email@example.com', 'mytheme'); ?></a><br><?php echo __('Tel.: +48 000 000 000', 'mytheme');?>
</p>
<!-- /wp:paragraph -->

I am aware it may be difficult to implement, but I'm just reporting the situations when I was forced to edit the generated template or pattern manually to make it deliverable.

I'm not even sure that every paragraph should be converted into a translation, but I have no idea how we could distinguish between the ones we want and the ones we don't.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions