Skip to content

Set translate as an attribute, not a property - #57

Open
Neverbirth wants to merge 2 commits into
MVCoconut:masterfrom
Neverbirth:translate-attribute
Open

Neverbirth wants to merge 2 commits into
MVCoconut:masterfrom
Neverbirth:translate-attribute

Conversation

@Neverbirth

@Neverbirth Neverbirth commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Makes translate="no" work, so page translators (Google, Microsoft, Safari) leave an element alone.

Attributes are assigned as DOM properties by default, but the translate property is a boolean: assigning "no" to it is truthy and sets translate="yes". translate is now set with setAttribute, as role already is.

The new Translate test fails without the change ("yes" == "no") and passes with it; all 31 assertions pass in Chromium.

tink_domspec is pinned to its master (46a2202), which has the attribute since haxetink/tink_domspec#44.

The translate property is a boolean, so assigning "no" to it set translate="yes". Needs haxetink/tink_domspec#44 for the attribute; the tink_domspec pin points at that PR's commit until it is merged.
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.

1 participant