Skip to content

Conversation

@joaquimrocha
Copy link
Contributor

Summary

This PR adds a couple of tools to improve the experience for translators.
It adds a couple of top level commands:
npm run i18n:status -> prints progress bars for each locale
npm run i18n:list -> lists locales and the percentage of completion

Also moves the former copy/missing translation commands to this top level variant (check docs).

Also adds docs.

How to test

Check the docs and run the commands to test them out.

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 28, 2025
@joaquimrocha joaquimrocha changed the base branch from i18n-improvements to main November 28, 2025 16:54
Copy link
Contributor

@skoeva skoeva left a comment

Choose a reason for hiding this comment

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

Is the failing CI a bug? Can't reproduce locally

Also unable to test the commands locally:

Image

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joaquimrocha

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@joaquimrocha
Copy link
Contributor Author

@skoeva , CI is fine now.

@ashu8912
Copy link
Member

ashu8912 commented Dec 4, 2025

Is the failing CI a bug? Can't reproduce locally

Also unable to test the commands locally:

Image

@joaquimrocha the comment from @skoeva about ts-node Permission denied, I got sh: ts-node: command not found
I did try npm i but the error still comes up when i try to run npm run i18n:status

Copy link
Contributor

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 PR introduces a new TypeScript-based i18n tool to improve the translator experience for Headlamp. It provides a unified command-line interface for managing translations with status views, file listings, extraction of empty translations, and copying translations between files.

  • Adds a new TypeScript tool in tools/i18n/ with comprehensive test coverage
  • Introduces top-level npm commands (i18n:status, i18n:list, i18n:extract, i18n:copy)
  • Deprecates old JavaScript tools in frontend/src/i18n/tools/
  • Adds extensive documentation for translators and developers

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/i18n/package.json Defines the new i18n tool package with dependencies and npm scripts
tools/i18n/package-lock.json Lock file for the new tool's dependencies
tools/i18n/tsconfig.json TypeScript configuration for the i18n tool
tools/i18n/jest.config.js Jest test configuration with coverage settings
tools/i18n/src/index.ts Main CLI entry point using yargs for command parsing
tools/i18n/src/lib/types.ts TypeScript type definitions for translations and stats
tools/i18n/src/lib/translations.ts Core translation file operations (load, save, count, copy, extract)
tools/i18n/src/lib/stats.ts Translation statistics and progress visualization
tools/i18n/src/lib/paths.ts Path resolution utilities for finding project root and locales
tools/i18n/src/lib/colors.ts Terminal color utilities for output formatting
tools/i18n/src/lib/commands.ts Implementation of all CLI commands (status, list, extract, copy)
tools/i18n/test/translations.test.ts Comprehensive integration tests for translation operations
tools/i18n/test/.gitignore Ignores test artifacts and coverage reports
tools/i18n/README.md Developer documentation for the tool
package.json Adds top-level npm scripts for i18n commands
frontend/src/i18n/README.md Updated with new command references and translator guidance
frontend/src/i18n/tools/extract-empty-translations.js Marked as deprecated with migration notice
frontend/src/i18n/tools/copy-translations.js Marked as deprecated with migration notice
docs/development/i18n/contributing.md Comprehensive update for translators with new workflow and commands
app/electron/i18next-parser.config.js Bug fix: changed namespaceSeparator to false

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants