feat(jsx): add global translate attribute to HTMLAttributes - #6808
Merged
johnjenkins merged 4 commits intoAug 4, 2026
Conversation
erik-gullberg
marked this pull request as ready for review
August 4, 2026 09:14
johnjenkins
approved these changes
Aug 4, 2026
johnjenkins
requested changes
Aug 4, 2026
johnjenkins
left a comment
Contributor
There was a problem hiding this comment.
let's just make this comment a bit less verbose :)
Co-authored-by: John Jenkins <johnljenkins@Hotmail.com>
johnjenkins
approved these changes
Aug 4, 2026
Contributor
Author
|
Thank you! @johnjenkins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the current behavior?
Stencil's JSX typings (
JSXBase.HTMLAttributes) include the standard global HTML attributes such asdir,lang,hidden,spellcheck, anddraggable, but omit the globaltranslateattribute.As a result,
<p translate="no">…</p>fails to type-check in a Stencil component, forcing consumers to work around it by spreading an untyped object.GitHub Issue Number: #6807
What is the new behavior?
Closes #6807
Adds
translatetoJSXBase.HTMLAttributesso it is available on every native and custom element, consistent with the other global HTML attributes already present:Documentation
N/A — this mirrors the existing global HTML attributes already documented via the type definitions.
Does this introduce a breaking change?
Purely additive to an interface; existing code continues to type-check.
Testing
These JSX attribute typings are validated by TypeScript at compile time and have no dedicated runtime unit test (the same is true for the sibling global attributes like
spellcheck,dir, andlang). Verified that:prettier --checkpasses for the modified file.