Skip to content

Conversation

snomiao
Copy link
Member

@snomiao snomiao commented Aug 18, 2025

Summary

  • Install and configure eslint-plugin-i18n-json for validation of i18n JSON translation files
  • Add ESLint rules for i18n JSON files validation
  • Set up required directory structure for plugin functionality
  • Run ESLint fix to apply automated fixes

Changes

  • Added eslint-plugin-i18n-json as dev dependency
  • Updated .eslintrc.json with i18n validation rules:
    • i18n-json/valid-json: Error for invalid JSON syntax
    • i18n-json/sorted-keys: Warning for unsorted translation keys
    • i18n-json/identical-keys: Error for inconsistent keys across locales
  • Created required directory structure and configuration files

Test plan

  • ESLint runs successfully without errors
  • Plugin validates translation JSON files in locales/ directory
  • Automated fixes are applied via bun run fix

🤖 Generated with Claude Code

@Copilot Copilot AI review requested due to automatic review settings August 18, 2025 17:22
Copy link

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
registry-web Ready Ready Preview Comment Oct 2, 2025 2:40pm

Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

Copy link

socket-security bot commented Aug 18, 2025

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.

View full report

Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

Check the visual changes and approve or request changes as needed.

Copy link

socket-security bot commented Aug 21, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​spaced-out/​eslint-plugin-i18n@​3.0.77810010098100

View full report

? `…${e.file_path?.slice(-18)}`
: e.file_path}
 L{e.line_number}
{t('L', 'L')}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L{{number}}

Comment on lines 405 to 406
{t('L', 'L')}
{e.line_number}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{t('L', 'L')}
{e.line_number}
{t('L{{number}}', 'L{{number}}', {number: e.line_number})}

@snomiao
Copy link
Member Author

snomiao commented Aug 22, 2025

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

snomiao and others added 9 commits September 22, 2025 10:25
- 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
snomiao and others added 6 commits September 22, 2025 10:26
…matting for better readability and maintainability
…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]>
- Update NodeVersionCompatibilityEditModal.tsx to use proper i18n interpolation
- Disable i18n static label checks in MockFeaturedPage.stories.tsx
Copy link

🎨 Chromatic Visual Testing Results

Resource URL
🔍 Build Results Chromatic Build
📚 Storybook View Storybook

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]>
- 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]>
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.

1 participant