Skip to content

feat(translations): remove i18n subcommand and group memsource commands into a subcommand#2418

Open
christoph-jerolimov wants to merge 3 commits intoredhat-developer:mainfrom
christoph-jerolimov:translations/regroup-subcommands
Open

feat(translations): remove i18n subcommand and group memsource commands into a subcommand#2418
christoph-jerolimov wants to merge 3 commits intoredhat-developer:mainfrom
christoph-jerolimov:translations/regroup-subcommands

Conversation

@christoph-jerolimov
Copy link
Member

Hey, I just made a Pull Request!

First two commands are already part of #2417. This PR changes how the cli work with some opiniated renamings:

Before:

./bin/translations-cli --help            
Usage: translations-cli [options] [command]

Options:
  -V, --version   output the version number
  -h, --help      display help for command

Commands:
  i18n [command]  Internationalization (i18n) management commands for translation workflows
  help [command]  display help for command

Everything is under i18n:

./bin/translations-cli i18n --help
Usage: translations-cli i18n [options] [command] [command]

Internationalization (i18n) management commands for translation workflows

Options:
  -h, --help                 display help for command

Commands:
  generate [options]         Generate translation reference files from source code
  upload [options]           Upload translation reference files to TMS (Translation Management System)
  list [options]             List available translation jobs from TMS
  download [options]         Download translated strings from TMS using Memsource CLI
  deploy [options]           Deploy downloaded translations to TypeScript translation files (it.ts, ja.ts, etc.)
  status [options]           Show translation status and statistics
  clean [options]            Clean up temporary i18n files and caches
  sync [options]             Complete i18n workflow: generate → upload → download → deploy
  init [options]             Initialize i18n configuration files
  setup-memsource [options]  Set up .memsourcerc file for Memsource CLI (follows localization team instructions)
  help [command]             display help for command

With this PR I removed the i18n group and grouped the memsource commands into a new subcommand:

./bin/translations-cli --help
Usage: translations-cli [options] [command]

Options:
  -V, --version        output the version number
  -h, --help           display help for command

Commands:
  init [options]       Initialize i18n configuration files
  generate [options]   Generate translation reference files from source code
  deploy [options]     Deploy downloaded translations to TypeScript translation files (it.ts, ja.ts, etc.)
  status [options]     Show translation status and statistics
  clean [options]      Clean up temporary i18n files and caches
  memsource [command]  Internationalization (i18n) management commands for translation workflows
  help [command]       display help for command

Memsource:

./bin/translations-cli memsource --help 
Usage: translations-cli memsource [options] [command] [command]

Internationalization (i18n) management commands for translation workflows

Options:
  -h, --help          display help for command

Commands:
  setup [options]     Set up .memsourcerc file for Memsource CLI (follows localization team instructions)
  upload [options]    Upload translation reference files to TMS (Translation Management System)
  download [options]  Download translated strings from TMS using Memsource CLI
  list [options]      List available translation jobs from TMS
  sync [options]      Complete i18n workflow: generate → upload → download → deploy
  help [command]      display help for command

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

…ommand and moved some files for this

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
…ds into a subcommand

Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Mar 2, 2026

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/translations-cli workspaces/translations/packages/cli patch v0.0.1

@rhdh-qodo-merge
Copy link

Review Summary by Qodo

Restructure CLI commands: remove i18n subcommand and group memsource commands

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Removed i18n subcommand, promoting core commands to top level
• Grouped Memsource/TMS commands under new memsource subcommand
• Reorganized command files into memsource/ subdirectory
• Replaced vitest with backstage-cli package test command
• Updated all documentation and CLI examples to reflect new structure
Diagram
flowchart LR
  A["Old Structure<br/>i18n [command]"] -->|Remove| B["Top-level Commands<br/>init, generate, deploy, status, clean"]
  A -->|Reorganize| C["memsource [command]<br/>setup, upload, download, list, sync"]
  D["Memsource Commands<br/>in src/commands/"] -->|Move| E["Memsource Commands<br/>in src/commands/memsource/"]
  F["vitest"] -->|Replace| G["backstage-cli package test"]
Loading

Grey Divider

File Changes

1. workspaces/translations/packages/cli/src/commands/index.ts ✨ Enhancement +21/-153

Restructure command registration for new CLI hierarchy

workspaces/translations/packages/cli/src/commands/index.ts


2. workspaces/translations/packages/cli/src/commands/memsource/index.ts ✨ Enhancement +170/-0

Create new memsource subcommand registration module

workspaces/translations/packages/cli/src/commands/memsource/index.ts


3. workspaces/translations/packages/cli/src/commands/memsource/download.ts ✨ Enhancement +3/-3

Move download command to memsource subdirectory

workspaces/translations/packages/cli/src/commands/memsource/download.ts


View more (27)
4. workspaces/translations/packages/cli/src/commands/memsource/upload.ts ✨ Enhancement +7/-9

Move upload command to memsource subdirectory

workspaces/translations/packages/cli/src/commands/memsource/upload.ts


5. workspaces/translations/packages/cli/src/commands/memsource/list.ts ✨ Enhancement +2/-2

Move list command to memsource subdirectory

workspaces/translations/packages/cli/src/commands/memsource/list.ts


6. workspaces/translations/packages/cli/src/commands/memsource/sync.ts ✨ Enhancement +5/-4

Move sync command to memsource subdirectory

workspaces/translations/packages/cli/src/commands/memsource/sync.ts


7. workspaces/translations/packages/cli/src/commands/deploy.ts ✨ Enhancement +1/-1

Update help text to reference new memsource command

workspaces/translations/packages/cli/src/commands/deploy.ts


8. workspaces/translations/packages/cli/src/commands/init.ts ✨ Enhancement +3/-5

Update imports and help text for new command structure

workspaces/translations/packages/cli/src/commands/init.ts


9. workspaces/translations/packages/cli/src/tests/generate.test.ts 🧪 Tests +3/-3

Skip broken test and remove vitest imports

workspaces/translations/packages/cli/src/tests/generate.test.ts


10. workspaces/translations/packages/cli/vitest.config.ts ⚙️ Configuration changes +0/-29

Remove vitest configuration file

workspaces/translations/packages/cli/vitest.config.ts


11. workspaces/translations/packages/cli/package.json Dependencies +8/-11

Replace vitest with backstage-cli and update test scripts

workspaces/translations/packages/cli/package.json


12. workspaces/translations/packages/cli/scripts/quick-test.sh ✨ Enhancement +1/-1

Update test script to use new CLI command structure

workspaces/translations/packages/cli/scripts/quick-test.sh


13. workspaces/translations/.changeset/better-keys-bet.md 📝 Documentation +5/-0

Add changeset for i18n subcommand removal

workspaces/translations/.changeset/better-keys-bet.md


14. workspaces/translations/.changeset/quick-mangos-teach.md 📝 Documentation +5/-0

Add changeset for vitest replacement

workspaces/translations/.changeset/quick-mangos-teach.md


15. workspaces/translations/packages/cli/cli-report.md 📝 Documentation +22/-22

Update CLI report with new command structure

workspaces/translations/packages/cli/cli-report.md


16. workspaces/translations/packages/cli/docs/TESTING-GUIDE.md 📝 Documentation +18/-10

Update testing guide for new CLI structure

workspaces/translations/packages/cli/docs/TESTING-GUIDE.md


17. workspaces/translations/packages/cli/docs/TESTING.md 📝 Documentation +26/-26

Update testing documentation with new commands

workspaces/translations/packages/cli/docs/TESTING.md


18. workspaces/translations/packages/cli/docs/TESTS.md 📝 Documentation +3/-5

Update test documentation for backstage-cli

workspaces/translations/packages/cli/docs/TESTS.md


19. workspaces/translations/packages/cli/docs/WORKFLOW_VERIFICATION.md 📝 Documentation +8/-8

Update workflow examples with new command syntax

workspaces/translations/packages/cli/docs/WORKFLOW_VERIFICATION.md


20. workspaces/translations/packages/cli/docs/download-deploy-usage.md 📝 Documentation +33/-33

Update usage examples for new memsource commands

workspaces/translations/packages/cli/docs/download-deploy-usage.md


21. workspaces/translations/packages/cli/docs/i18n-commands.md 📝 Documentation +61/-61

Update comprehensive guide for new CLI structure

workspaces/translations/packages/cli/docs/i18n-commands.md


22. workspaces/translations/packages/cli/docs/manual-test-checklist.md 📝 Documentation +20/-20

Update manual test checklist with new commands

workspaces/translations/packages/cli/docs/manual-test-checklist.md


23. workspaces/translations/packages/cli/docs/multi-repo-deployment.md 📝 Documentation +18/-18

Update multi-repo deployment guide with new syntax

workspaces/translations/packages/cli/docs/multi-repo-deployment.md


24. workspaces/translations/packages/cli/knip-report.md 📝 Documentation +0/-6

Remove vitest coverage dependency from report

workspaces/translations/packages/cli/knip-report.md


25. workspaces/translations/packages/cli/scripts/compare-reference-files.sh Additional files +0/-0

...

workspaces/translations/packages/cli/scripts/compare-reference-files.sh


26. workspaces/translations/packages/cli/scripts/integration-test.sh Additional files +0/-0

...

workspaces/translations/packages/cli/scripts/integration-test.sh


27. workspaces/translations/packages/cli/scripts/real-repo-test.sh Additional files +0/-0

...

workspaces/translations/packages/cli/scripts/real-repo-test.sh


28. workspaces/translations/packages/cli/scripts/workflow-verification.ts Additional files +0/-0

...

workspaces/translations/packages/cli/scripts/workflow-verification.ts


29. workspaces/translations/packages/cli/src/commands/memsource/setup.ts Additional files +0/-0

...

workspaces/translations/packages/cli/src/commands/memsource/setup.ts


30. workspaces/translations/packages/cli/src/tests/test-helpers.ts Additional files +0/-0

...

workspaces/translations/packages/cli/src/tests/test-helpers.ts


Grey Divider

Qodo Logo

@rhdh-qodo-merge
Copy link

rhdh-qodo-merge bot commented Mar 2, 2026

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Test scripts broken 🐞 Bug ⛯ Reliability
Description
@red-hat-developer-hub/translations-cli now invokes scripts under ./scripts/*, but those scripts
still run removed translations-cli i18n ... commands and expect i18n/reference.json. As a
result, yarn test:quick, test:integration, test:real-repo, and test:workflow will fail or
validate the wrong behavior.
Code

workspaces/translations/packages/cli/package.json[R22-27]

+    "test": "backstage-cli package test",
+    "test:quick": "./scripts/quick-test.sh",
+    "test:integration": "./scripts/integration-test.sh",
+    "test:real-repo": "./scripts/real-repo-test.sh",
+    "test:workflow": "tsx scripts/workflow-verification.ts",
+    "test:manual": "echo 'See docs/manual-test-checklist.md for manual testing steps'",
Evidence
package.json wires yarn test:* to scripts that still call i18n generate and check for
reference.json, but the PR removes the i18n group and generate requires --sprint, so these
scripts no longer match the CLI interface and output behavior.

workspaces/translations/packages/cli/package.json[19-32]
workspaces/translations/packages/cli/scripts/quick-test.sh[14-55]
workspaces/translations/packages/cli/scripts/integration-test.sh[93-104]
workspaces/translations/packages/cli/scripts/workflow-verification.ts[264-273]
workspaces/translations/packages/cli/src/commands/index.ts[44-51]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The CLI removed the `i18n` command group and requires `--sprint` for `generate`, but multiple repo scripts invoked by `yarn test:*` still call `translations-cli i18n ...` and check for `i18n/reference.json`. This breaks the package’s documented/release testing workflows.

### Issue Context
- `package.json` now points `test:quick`, `test:integration`, `test:real-repo`, and `test:workflow` to `./scripts/*`, so these scripts are expected to work.
- The CLI now registers `generate` as a top-level command and requires `--sprint`.

### Fix Focus Areas
- workspaces/translations/packages/cli/scripts/quick-test.sh[14-55]
- workspaces/translations/packages/cli/scripts/integration-test.sh[93-110]
- workspaces/translations/packages/cli/scripts/real-repo-test.sh[28-60]
- workspaces/translations/packages/cli/scripts/compare-reference-files.sh[41-55]
- workspaces/translations/packages/cli/scripts/workflow-verification.ts[260-280]
- workspaces/translations/packages/cli/src/commands/index.ts[44-60]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. imemsource typo 🐞 Bug ✓ Correctness
Description
Documentation contains an invalid command translations-cli imemsource download ... which will fail
when copied. This typo was introduced while renaming i18n download to memsource download.
Code

workspaces/translations/packages/cli/docs/download-deploy-usage.md[50]

+translations-cli imemsource download --job-ids "13,14,16,17,19,20"
Evidence
The doc example includes a misspelled subcommand (imemsource) which does not exist in the CLI.

workspaces/translations/packages/cli/docs/download-deploy-usage.md[44-56]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
A doc example uses an invalid command (`imemsource`) and will fail when copied.

### Issue Context
The CLI subcommand is `memsource`, not `imemsource`.

### Fix Focus Areas
- workspaces/translations/packages/cli/docs/download-deploy-usage.md[47-51]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. CLI report inconsistent 🐞 Bug ✧ Quality
Description
cli-report.md was partially updated but still lists i18n [command] and old top-level commands,
conflicting with the new CLI layout. This will confuse users and any process relying on the report.
Code

workspaces/translations/packages/cli/cli-report.md[R19-23]

+### `translations-cli`

-Usage: translations-cli i18n [options] [command] [command]
+Usage: translations-cli [options] [command] [command]

</details>
Evidence
The report’s summary sections still mention the removed i18n group and commands which were moved
under memsource, even though other parts of the same file reflect the new structure (e.g.,
translations-cli memsource download).

workspaces/translations/packages/cli/cli-report.md[5-17]
workspaces/translations/packages/cli/cli-report.md[22-39]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`cli-report.md` is internally inconsistent after the command regrouping, still advertising `i18n` and moved commands.

### Issue Context
The file claims it is generated; it should be regenerated from the current CLI.

### Fix Focus Areas
- workspaces/translations/packages/cli/cli-report.md[5-39]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Breaking change as patch 🐞 Bug ⛯ Reliability
Description
The changeset marks the CLI regrouping as a patch bump even though it removes/renames user-facing
commands (i18n group removed, commands moved under memsource). This can unexpectedly break
existing automation for consumers updating within a patch range.
Code

workspaces/translations/.changeset/better-keys-bet.md[R1-5]

+---
+'@red-hat-developer-hub/translations-cli': patch
+---
+
+Removed i18n subcommand and grouped memsource/TMS commands into a new memsource subcommand.
Evidence
The changeset explicitly declares a patch bump while describing a breaking CLI change (removal of
the i18n subcommand group).

workspaces/translations/.changeset/better-keys-bet.md[1-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The changeset declares a patch bump for a breaking CLI interface change.

### Issue Context
Removing/renaming CLI commands is a breaking change for users and automation.

### Fix Focus Areas
- workspaces/translations/.changeset/better-keys-bet.md[1-5]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

Comment on lines +22 to +27
"test": "backstage-cli package test",
"test:quick": "./scripts/quick-test.sh",
"test:integration": "./scripts/integration-test.sh",
"test:real-repo": "./scripts/real-repo-test.sh",
"test:workflow": "tsx scripts/workflow-verification.ts",
"test:manual": "echo 'See docs/manual-test-checklist.md for manual testing steps'",

Choose a reason for hiding this comment

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

Action required

1. Test scripts broken 🐞 Bug ⛯ Reliability

@red-hat-developer-hub/translations-cli now invokes scripts under ./scripts/*, but those scripts
still run removed translations-cli i18n ... commands and expect i18n/reference.json. As a
result, yarn test:quick, test:integration, test:real-repo, and test:workflow will fail or
validate the wrong behavior.
Agent Prompt
### Issue description
The CLI removed the `i18n` command group and requires `--sprint` for `generate`, but multiple repo scripts invoked by `yarn test:*` still call `translations-cli i18n ...` and check for `i18n/reference.json`. This breaks the package’s documented/release testing workflows.

### Issue Context
- `package.json` now points `test:quick`, `test:integration`, `test:real-repo`, and `test:workflow` to `./scripts/*`, so these scripts are expected to work.
- The CLI now registers `generate` as a top-level command and requires `--sprint`.

### Fix Focus Areas
- workspaces/translations/packages/cli/scripts/quick-test.sh[14-55]
- workspaces/translations/packages/cli/scripts/integration-test.sh[93-110]
- workspaces/translations/packages/cli/scripts/real-repo-test.sh[28-60]
- workspaces/translations/packages/cli/scripts/compare-reference-files.sh[41-55]
- workspaces/translations/packages/cli/scripts/workflow-verification.ts[260-280]
- workspaces/translations/packages/cli/src/commands/index.ts[44-60]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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