Skip to content

Conversation

@ciiay
Copy link
Member

@ciiay ciiay commented Dec 4, 2025

Hey, I just made a Pull Request!

For RHIDP-9806

✔️ 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)

@ciiay ciiay requested review from a team, debsmita1 and karthikjeeyar as code owners December 4, 2025 21:18
@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Dec 4, 2025

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-translations-test
  • @red-hat-developer-hub/backstage-plugin-translations

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/translations-cli workspaces/translations/packages/cli none v0.1.0
@red-hat-developer-hub/backstage-plugin-translations-test workspaces/translations/plugins/translations-test none v0.1.0
@red-hat-developer-hub/backstage-plugin-translations workspaces/translations/plugins/translations none v0.1.0

@ciiay ciiay force-pushed the rhidp-9806-add-i18n-cli-tools branch 2 times, most recently from 06b8735 to 4385805 Compare December 12, 2025 05:34
@ciiay ciiay force-pushed the rhidp-9806-add-i18n-cli-tools branch from da5198d to 213a163 Compare December 12, 2025 20:09
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
…epo support

- Add download command to fetch completed translations from Memsource
  - Support downloading all completed jobs or specific job IDs
  - Support filtering by languages
  - Auto-detects repo type and filters files accordingly

- Add deploy command to deploy translations to TypeScript files
  - Universal deployment script supporting rhdh-plugins, community-plugins, and rhdh
  - Auto-detects repository structure and plugin locations
  - Handles different file naming conventions ({lang}.ts vs {plugin}-{lang}.ts)
  - Correctly handles import paths (./ref, ./translations, external @backstage packages)
  - Updates existing files and creates new translation files
  - Automatically updates index.ts files to register translations

- Add comprehensive documentation
  - Complete workflow guide for download and deployment
  - Multi-repo deployment documentation
  - Step-by-step instructions for all three repositories

- Update yarn.lock with latest dependencies
…sues

- Replace execSync with safe spawnSync to prevent command injection
  - Create safeExecSync, commandExists, and safeExecSyncOrThrow utilities
  - Use separate command and args arrays for safer execution
  - Cross-platform support (Windows/Unix) for command existence checks
  - Applied to upload, download, deploy, and config commands

- Remove code duplication to improve maintainability
  - Extract key counting logic to countTranslationKeys() utility
  - Extract download command args to buildDownloadJobArgs() helper
  - Extract job listing args to buildListJobsArgs() helper
  - Extract job download logic to downloadJob() helper function

- Fix regex operator precedence in PO file parsing
  - Group alternation explicitly: /(^["']|["']$)/g
  - Makes operator precedence clear for SonarQube compliance
  - Applied to 3 locations in loadFile.ts

All changes are refactoring only - no functional changes to workflow.
Build and lint checks pass successfully.
Signed-off-by: Yi Cai <yicai@redhat.com>
@ciiay ciiay force-pushed the rhidp-9806-add-i18n-cli-tools branch from effaf47 to 59a7a6d Compare December 23, 2025 23:22
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant