-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Open
Labels
apprenticeIssues that are good candidates to be handled by a Docusaurus apprentice / traineeIssues that are good candidates to be handled by a Docusaurus apprentice / traineedomain: dxRelated to developer experience of working on Docusaurus sitesRelated to developer experience of working on Docusaurus sitesfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.If you are just getting started with Docusaurus, this issue should be a good place to begin.status: accepting prThis issue has been accepted, and we are looking for community contributors to implement thisThis issue has been accepted, and we are looking for community contributors to implement this
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Motivation
I realized there are a few text labels in our repo that are accidentally not translated. This has happened a few times in the past as well (see #4542). It would be interesting if we can make an eslint plugin with two rules:
no-dynamic-i18n-messages: ensures that all translate calls are plain text labelsno-untranslated-text: ensures all text labels in JSX are wrapped by translate calls (may have lots of false positives, but interesting to see how close we can get)
See https://docusaurus.io/docs/next/i18n/tutorial#translate-your-react-code for some documentation of the mental model of translate APIs.
We can publish this plugin as @docusaurus/eslint-plugin, so users can use this for themselves, as well as plugin/theme authors.
We may even ensure more best practices:
prefer-docusaurus-link: ensures@docusaurus/Linkis used instead ofatagsprefer-ideal-image: ensures@theme/IdealImageis used instead ofimgtagsprefer-docusaurus-heading: ensures@theme/Headingis used instead ofh2tagsno-hardcoded-src: ensures allsrcattributes are eitherrequireoruseBaseUrlno-window-eq-undefined: forbidtypeof window !== 'undefined'because this is not an adequate way to escape SSR
Self-service
- I'd be willing to do some initial work on this proposal myself.
prince-chrismc, K0rdan, Ab2nour and JoshuaKGoldbergTheCatLady and Devansu-Yadav
Metadata
Metadata
Assignees
Labels
apprenticeIssues that are good candidates to be handled by a Docusaurus apprentice / traineeIssues that are good candidates to be handled by a Docusaurus apprentice / traineedomain: dxRelated to developer experience of working on Docusaurus sitesRelated to developer experience of working on Docusaurus sitesfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.good first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.If you are just getting started with Docusaurus, this issue should be a good place to begin.status: accepting prThis issue has been accepted, and we are looking for community contributors to implement thisThis issue has been accepted, and we are looking for community contributors to implement this