codelyzer icon indicating copy to clipboard operation
codelyzer copied to clipboard

i18n rule check-text does not work

Open Martin-Luft opened this issue 7 years ago • 6 comments

  • codelyzer 4.1.0
  • Angular 5.2.1
  • TypeScript 2.6.2

"i18n": [true, "check-text"] does not work for this examples:

<label class="checkbox-inline" i18n="Bearbeiten eines Artikels|Veröffentlichung im Internet?">
  <input name="article.publish" [(ngModel)]="article.publish" role="edit" type="checkbox">
  Veröffentlichen
</label>

edit-article.component.html[35, 110]: Each element containing text node should have an i18n attribute

or

<p class="text-muted" i18n="Aktueller Anwender|Auflistung der Rollen" *ngIf="user$ | async as user; else userIsLoading">{{user.firstName}} {{user.lastName}} (Rollen: {{user.roles}})</p>
<ng-template #userIsLoading i18n="Aktueller Anwender|Daten werden geladen">Anwender wird geladen...</ng-template>

ERROR: user.component.html[2, 75]: Each element containing text node should have an i18n attribute

And can you please explain which codelyzer rules are stable and production ready and which not? For example you said that the no-unused-css rule is not stable (here https://github.com/mgechev/codelyzer/issues/364) and this i18n rule seems to be unstable as well.

Martin-Luft avatar Jan 22 '18 10:01 Martin-Luft

Thanks for reporting the issue. I will add test for your specific examples and fix the issues. The i18n rules were recently added, we are still figuring out the correct behavior in some cases.

mgechev avatar Jan 22 '18 15:01 mgechev

There is an issue opened concerning the status of each rule #408. In the meantime, maybe can we a this status in our Readme.

wKoza avatar Jan 23 '18 20:01 wKoza

I'll update the readme in a sec.

mgechev avatar Jan 23 '18 20:01 mgechev

@mgechev you missed the following rules:

import-destructuring-spacing, pipe-naming and no-output-named-after-standard-event.

@mgechev and the rules page (http://codelyzer.com/rules/) doesn't contain:

trackBy-function and no-output-named-after-standard-event

Should I open a new issue for that?

Martin-Luft avatar Jan 24 '18 09:01 Martin-Luft

Yes @Martin-Wegner , you can !

wKoza avatar Jan 24 '18 10:01 wKoza

https://github.com/mgechev/codelyzer/issues/501

Martin-Luft avatar Jan 24 '18 10:01 Martin-Luft