Skip to content
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

Add i18n linting #1567

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Add i18n linting #1567

merged 1 commit into from
Jun 5, 2024

Conversation

Mephistic
Copy link
Collaborator

Summary

We want to be able to identify unextracted user-visible text for I18n translation - both to help with clearing out the backlog of existing text to extract and to ensure we maintain the standard going forward.

To that end, this PR enables an eslint rule to warn about unextracted literal strings. The game plan is to enable this at a non-blocking warn level while we clear out the backlog, and then flip this to an actual build error once the codebase is fully compliant to ensure it stays that way.

Checklist

  • [na] On the frontend, I've made my strings translate-able.
  • [na] If I've added shared components, I've added a storybook story.
  • [na] I've made pages responsive and look good on mobile.

Screenshots

This will produce warnings that look like:

./components/bill/TestimonyCounts.tsx
63:45  Error: disallow literal string: <CountTotal className={`ms-2`}>{total} Total Testimonies</CountTotal>  i18next/no-literal-string
66:26  Error: disallow literal string: <CountCategory>Endorse</CountCategory>  i18next/no-literal-string
75:26  Error: disallow literal string: <CountCategory>Neutral</CountCategory>  i18next/no-literal-string
84:26  Error: disallow literal string: <CountCategory>Oppose</CountCategory>  i18next/no-literal-string


./components/buttons.tsx
337:39  Error: disallow literal string: <Tooltip {...props}>Copied to Clipboard!</Tooltip>  i18next/no-literal-string

Known issues

N/A

Steps to test/reproduce

N/A

Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maple-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 5:02am

@mertbagt mertbagt merged commit b6d616f into codeforboston:main Jun 5, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants