WordPress / WordPress/WordPress-Coding-Standards
Check for missing text domain in JavaScript i18n function calls
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
Is your feature request related to a problem?
wp.i18n JavaScript functions can be used in plugins and themes, but there is currently no check to ensure that they have a text domain argument.
Describe the solution you'd like
Add a sniff that checks for text domain (and possibly other i18n-related issues), for JS, like the one for PHP. It could be that this one gets updated to cover PHP and JS, but that may make it trickier to understand, since it's not the same groups of functions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing PHP implementation in WordPress/Sniffs/WP/I18nSniff.php and the linked wp.i18n JavaScript functions. Define the JavaScript calls that require a text domain and whether other i18n checks are in scope; done means the new sniff detects missing text domains consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- internationalization, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100