-
Notifications
You must be signed in to change notification settings - Fork 235
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 check-text edge cases #442
Comments
Thanks for reporting this! Added it to the next release. |
@Manduro the rule with the
In such case, the first template is invalid, right? |
@Manduro would you take a look at the referenced PR and tell me if you think that's the behavior you think the rule should have? In the end, the content of the element with i18n will be replaced by the compiler so the interpolation will be lost, right? If that's the case, I'd suggest to introduce another config option to this rule which warns when an interpolation is used inside of an element with i18n attribute. |
I'm not an i18n Expert, but the Angular documentation says that we can use interpolation with i18n attribute : see https://angular.io/guide/i18n#translate-singular-and-plural |
Yes we can use interpolation if I'm correct, but be sure to double check it! I'm not sure if the first case I submitted is valid. Maybe it was just my wishful thinking. I'd probably need to split that into two elements with two i18n attributes. |
For me, it's not valid if we take a look at this : angular/angular#18302 |
Sounds good. Looks like the PR I opened fixes the second, incorrect, behavior. Let me know if you think we can add anything else. |
* fix(i18n): do not warn with interpolation in i18n element Fix #442 * chore: support for angular 5.2
* fix(i18n): do not warn with interpolation in i18n element Fix #442 * test: add specs for check-interpolation * test: run all tests
Some cases where the i18n rule with
check-text
errors, but shouldn't (imo):The text was updated successfully, but these errors were encountered: