-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[i18n] option to check content of tag with i18n #930
Labels
package: eslint-plugin-template
Angular Template rules
triage
This issue needs to be looked at and categorized by a maintainer
Comments
superole
added
package: eslint-plugin-template
Angular Template rules
triage
This issue needs to be looked at and categorized by a maintainer
labels
Feb 24, 2022
We ran into a very similar situation using web components with Angular and slotted content: invalid: <my-button i18n>
<my-icon slot="icon"></my-icon>
Hello World
</my-button> valid: <my-button>
<my-icon slot="icon"></my-icon>
<span i18n>Hello World</span>
</my-button> The invalid case resulted in the icon html being considered part of the localized string which isn't what we really wanted and I expect few do. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
package: eslint-plugin-template
Angular Template rules
triage
This issue needs to be looked at and categorized by a maintainer
Description and reproduction of the issue
I would like to propose that you include an option to the i18n rule.
This option should make the rule check the content of a tag that has the i18n attribute set, and report if the content is not plain text (eg. it contains markup).
I recently discovered that a misplaced i18n attribute caused a bug in an application, because the markup content in the tag was replaced with plain text.
I try to enforce the convention that markup (and application logic) should not be mixed with i18n, and I would like this rule to help me with that. Therefore it is also my opinion that this new option should be enabled by default.
OR
Invalid code for this rule
OR
Valid code for this rule
OR
The text was updated successfully, but these errors were encountered: