Skip to content

Don't translate built in style strings (WP-911)#550

Merged
vsolovei-smartling merged 5 commits intomasterfrom
WP-911-3
Nov 25, 2024
Merged

Don't translate built in style strings (WP-911)#550
vsolovei-smartling merged 5 commits intomasterfrom
WP-911-3

Conversation

@vsolovei-smartling
Copy link
Copy Markdown
Contributor

No description provided.

<!-- /wp:html -->

<!-- wp:paragraph {"fontSize":"large","smartlingLockId":"rootlocked","smartlingLockedAttributes":"fontSize"} -->
<!-- wp:paragraph {"fontsize":"large","smartlingLockId":"rootlocked","smartlingLockedAttributes":"fontSize"} -->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only do not translate style, but fontsize we do, right? Do we have tests for style strings translation like these ones with fontsize?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fontSize is a built-in property, as is style, they should be copied. I had to rename the test property to fontsize, because it tests locking to ensure only locked properties get copied, other properties should translate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests currently test for style property

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests currently test for style property

ok, I thought this PR for style attribute.

But I saw test where fontsize still has pseudo translation. Is this expected in test? sounds like it should not happen

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filters are case sensitive, fontSize should now get copied, fontsize is translated. In this test, on lines 64-77 we update the attribute and add locking, changing the original translation to a user-modified string. The expected result for the test is that on next download, the replaced strings without locking to revert to pseudo-translation, and the locked ones should stay as the user has left them

Comment thread tests/IntegrationTests/tests/GutenbergBlocksTest.php Outdated
@vsolovei-smartling vsolovei-smartling merged commit 2a62584 into master Nov 25, 2024
@vsolovei-smartling vsolovei-smartling deleted the WP-911-3 branch November 25, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants