teach eslint to check translations
What does this PR do?
This adds a custom ESLint rule that detects expressions of the form i18n.ts.*
and i18n.tsx.*
, and checks that they refer to existing elements in the translations. It also tries to check that parametric translations are called with the right arguments.
Tests are expected to fail, because there are, in fact, some missing translations.
If you all like the idea (and the implementation), we should rebase this after merging 2024.9 and add the missing translations.
Contribution Guidelines By submitting this merge request, you agree to follow our Contribution Guidelines
-
I agree to follow this project's Contribution Guidelines -
I have made sure to test this pull request
Merge request reports
Activity
added enhancement label
- Resolved by dakkar
reset approvals from @fEmber by pushing to the branch
added 304 commits
-
d8edb355...ba17776b - 296 commits from branch
develop
- c70b5de8 - lint all uses of translations
- 025e8528 - fix CallExpression detection
- 702aff48 - fix argument/parameter checking
- ade919ac - ignore weirder cases
- 35419eec - lint Vue templates as well
- 3983786f - ignore more weirdness
- f90fe1ea - fix operator
- f500125f - lint translations in embeds, too
Toggle commit list-
d8edb355...ba17776b - 296 commits from branch
reset approvals from @fEmber by pushing to the branch
added 16 commits
-
f500125f...90d8050d - 5 commits from branch
develop
- 402b8543 - 1 earlier commit
- 47057414 - fix CallExpression detection
- bd50fc11 - fix argument/parameter checking
- 425ff4cb - ignore weirder cases
- 4f90bbd6 - lint Vue templates as well
- d586dc4d - ignore more weirdness
- 9ad03676 - fix operator
- b3d98b01 - lint translations in embeds, too
- 195d30e2 - use `en-US` translations for linting
- 29e17716 - don't lint translations in translation test
- c213f831 - fix (sort of) all missing translations
Toggle commit list-
f500125f...90d8050d - 5 commits from branch
added 20 commits
-
c213f831...649b525a - 9 commits from branch
develop
- f1243028 - 1 earlier commit
- 5fd0a03b - fix CallExpression detection
- 1effe1d9 - fix argument/parameter checking
- 2304dccb - ignore weirder cases
- e589e3ab - lint Vue templates as well
- c18d7754 - ignore more weirdness
- 694b4e00 - fix operator
- 4fd54229 - lint translations in embeds, too
- df7f9229 - use `en-US` translations for linting
- 1db055b1 - don't lint translations in translation test
- cb677bfc - fix (sort of) all missing translations
Toggle commit list-
c213f831...649b525a - 9 commits from branch
added tooling label
added 21 commits
-
9385baf7...42e2a586 - 14 commits from branch
develop
- 82674d87 - lint all uses of translations
- dba32772 - fix CallExpression detection
- 30d53de3 - fix argument/parameter checking
- f11536c9 - ignore weirder cases
- b0bc24f0 - lint Vue templates as well
- d466e05e - ignore more weirdness
- a7a630bf - fix operator
Toggle commit list-
9385baf7...42e2a586 - 14 commits from branch
reset approvals from @Marie by pushing to the branch