fix: allow setting i18n before upgrading element#11325
Merged
web-padawan merged 1 commit intomainfrom Mar 11, 2026
Merged
Conversation
|
sissbruecker
commented
Mar 11, 2026
| return { | ||
| // Even though the property is overridden by a custom getter/setter, it needs to be declared here to initialize | ||
| // __effectiveI18n properly if the i18n property is set before upgrading the element. | ||
| i18n: { |
Contributor
Author
There was a problem hiding this comment.
The property would be public now, which also make CEM work. Not sure if that has any other side effects, for example when generating React components.
|
|
||
| static get observedAttributes() { | ||
| return [...super.observedAttributes, 'i18n']; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Setting per attribute seems to be covered by Lit now. The only thing that doesn't work is setting invalid JSON, removed the test case for that as I think that setting the I18N per attribute is in general not common or something to encourage.
web-padawan
approved these changes
Mar 11, 2026
Collaborator
|
This ticket/PR has been released with Vaadin 25.1.0-beta3. |
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.



Description
#11178 caused a regression where setting
i18nbefore upgrading an element results in__effectiveI18nnot being calculated and thei18nsetter not working properly afterwards. This is currently reproducable in the side nav dev page where rendering child items is broken because__effectiveI18nis undefined. It looks like the property needs to be declared to make Lit remove the data property during the upgrade, which otherwise shadows the custom setter.This restores the
i18nproperty declaration.Type of change