-
Notifications
You must be signed in to change notification settings - Fork 7
Add i18n ESLint plugin configuration #211
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds internationalization (i18n) validation to the project by installing and configuring the eslint-plugin-i18n-json
plugin to validate JSON translation files.
- Installs
eslint-plugin-i18n-json
as a development dependency - Configures ESLint rules for JSON translation validation with error and warning levels
- Creates required configuration files for the i18n plugin functionality
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
package.json | Adds eslint-plugin-i18n-json as dev dependency |
.eslintrc.json | Configures i18n ESLint rules for JSON validation |
translations/static-label-pairing.js | Creates empty configuration file for static label pairing |
translations/static-label-pairing.cjs | Creates CommonJS version of static label pairing config |
src/components/lib/i18n/translations/en.json | Adds comprehensive English translation file with 399 translation keys |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
🎨 Chromatic Visual Testing Results
Check the visual changes and approve or request changes as needed. |
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
🎨 Chromatic Visual Testing Results
Check the visual changes and approve or request changes as needed. |
🎨 Chromatic Visual Testing Results
Check the visual changes and approve or request changes as needed. |
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
components/NodeStatusReason.tsx
Outdated
? `…${e.file_path?.slice(-18)}` | ||
: e.file_path} | ||
L{e.line_number} | ||
{t('L', 'L')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L{{number}}
components/NodeStatusReason.tsx
Outdated
{t('L', 'L')} | ||
{e.line_number} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{t('L', 'L')} | |
{e.line_number} | |
{t('L{{number}}', 'L{{number}}', {number: e.line_number})} |
let sno try to remove src/components/lib/i18n/translations/en.json if possible, or add a readme for src/components/lib/i18n/translations/en.json in src/components/lib/i18n/translations/README.md |
- Install eslint-plugin-i18n-json for JSON translation file validation - Configure ESLint rules for i18n JSON files: - valid-json: Error for invalid JSON syntax - sorted-keys: Warning for unsorted translation keys - identical-keys: Error for inconsistent keys across locales - Set up required directory structure and files - Run ESLint fix to apply automated fixes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Added eslint-plugin-i18n-json package to enforce i18n JSON file standards - Configured ESLint rules for JSON validation, key sorting, and consistency - Fixed React hooks dependency warning in claim-my-node component - Verified linting and build processes work correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…-json - Replaced eslint-plugin-i18n-json with @spaced-out/eslint-plugin-i18n v3.0.5 - Created required configuration files for the plugin to work properly - Added translations/static-label-pairing.cjs for plugin compatibility - Created symlink to existing translation files in expected location - Configured ESLint with missing-translation rule for i18n validation - Fixed React hooks dependencies warning in claim-my-node component - Verified both lint and build processes work correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Replace .eslintrc.json with .eslintrc.yaml for better readability - Configure @spaced-out/i18n plugin with progressive enablement approach - Update scan-i18n.ts to support default values in translation keys - Add support for t(key, defaultValue) pattern - Improve translation key extraction with better error handling 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Applied ESLint fixes to ensure proper internationalization patterns across the codebase using @spaced-out/eslint-plugin-i18n. This enforces consistent usage of translation functions and prevents hardcoded text strings. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ionalization support in status badge component feat(NodeStatusReason): integrate useNextTranslation hook for internationalization support in YAML components
…nto separate functional components for better readability and maintainability
…matting for better readability and maintainability
…und Beta text for cleaner code readability
…18n support in admin dashboard HOC
…tenation - Replace string concatenation patterns like `{count} {t('Nodes')}` - Use proper i18n interpolation with `{{count}}` syntax - Update SearchHit component: `{{matched}}/{{total}} Nodes matched` - Update admin pages: `Total: {{count}} nodes` and `{{status}} Nodes` - Fix NodeStatusBadge to use `×{{count}}` interpolation - Ensure proper pluralization support for future translations Examples: - `{hit.comfy_nodes?.length ?? 0} {t('Nodes')}` → `{t('{{count}} Nodes', { count: hit.comfy_nodes?.length ?? 0 })}` - `{statusNames[status]} {t('Nodes')}` → `{t('{{status}} Nodes', { status: statusNames[status] })}` 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…ates - Remove duplicate translations/static-label-pairing.cjs file - Keep only static-label-pairing.js with universal CommonJS/ES module exports - Replace duplicate src/components/lib/i18n/translations/en.json with symlink to locales/en/common.json - Fix ESLint YAML syntax error - Maintain single source of truth for translation files Benefits: - Eliminates file duplication and sync issues - Cleaner project structure - ESLint plugin still works correctly - Translation files stay automatically in sync 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove unnecessary ESM export since ESLint plugin uses require() - Use .cjs extension for proper CommonJS handling in ES module project - Create .js symlink for plugin compatibility (plugin expects .js path) - Keep only the format that's actually used by the ESLint plugin Result: Cleaner, single-format configuration file. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
c5ba12a
to
72b8f49
Compare
- Update NodeVersionCompatibilityEditModal.tsx to use proper i18n interpolation - Disable i18n static label checks in MockFeaturedPage.stories.tsx
🎨 Chromatic Visual Testing Results
Check the visual changes and approve or request changes as needed. |
- Update plugin references from @spaced-out/eslint-plugin-i18n to eslint-plugin-i18n-json in static-label-pairing files - Fix NodeStatusReason L{{number}} interpolation to use proper i18next format 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
827742a
to
0281ed9
Compare
- Remove unused src/components/lib/i18n/translations/en.json symlink pointing to locales/en/common.json - Remove unused translations/static-label-pairing.js symlink pointing to static-label-pairing.cjs - Clean up empty directories left behind These symlinks were creating file duplications in the repository without being used. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Summary
eslint-plugin-i18n-json
for validation of i18n JSON translation filesChanges
eslint-plugin-i18n-json
as dev dependency.eslintrc.json
with i18n validation rules:i18n-json/valid-json
: Error for invalid JSON syntaxi18n-json/sorted-keys
: Warning for unsorted translation keysi18n-json/identical-keys
: Error for inconsistent keys across localesTest plan
locales/
directorybun run fix
🤖 Generated with Claude Code