Skip to content

feat(translations): parallelize translation extraction + show progress#343

Open
bertyhell wants to merge 2 commits into
mainfrom
feature/translations-extraction-parallel
Open

feat(translations): parallelize translation extraction + show progress#343
bertyhell wants to merge 2 commits into
mainfrom
feature/translations-extraction-parallel

Conversation

@bertyhell

@bertyhell bertyhell commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
npm run translations:extract:hetarchief

 █████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░  32% | total             | 0/3 done
 ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   5% | admin-core        | reading existing translations...
 ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   5% | hetarchief-client | reading existing translations...
 ██████████████████████████████████░░░░░░  85% | hetarchief-proxy  | saving...

final result:

npm run translations:extract:hetarchief

> @meemoo/admin-core-ui@5.2.83 translations:extract:hetarchief
> dotenv -e .env/.env.local tsx --project ./scripts/tsconfig.json scripts/extract-and-replace-translations.ts -- HET_ARCHIEF

 ████████████████████████████████████████ 100% | total             | 3/3 done
 ████████████████████████████████████████ 100% | admin-core        | done
 ████████████████████████████████████████ 100% | hetarchief-client | done
 ████████████████████████████████████████ 100% | hetarchief-proxy  | done
Wrote 1015 to C:\Users\verheb4\Documents\studiohyperdrive\repos\meemoo\react-admin-core-module\ui\src\shared\translations\hetArchief\nl.json
	0 translations added
	0 translations deleted
Wrote 110 to C:\Users\verheb4\Documents\studiohyperdrive\repos\meemoo\hetarchief-proxy\src\shared\i18n\locales\nl.json
	0 translations added
	0 translations deleted
Wrote 1654 to C:\Users\verheb4\Documents\studiohyperdrive\repos\meemoo\hetarchief-client\public\locales\nl\common.json
	0 translations added
	0 translations deleted
Writing SQL file: C:\Users\verheb4\Documents\studiohyperdrive\repos\meemoo\react-admin-core-module\ui\all-translations-het-archief.sql
Writing json file: C:\Users\verheb4\Documents\studiohyperdrive\repos\meemoo\react-admin-core-module\ui\all-translations-het-archief.json
Finished writing 5558 translations

Copilot AI left a comment

Copy link
Copy Markdown

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 improves the translation extraction script by running per-component extraction in parallel and rendering live progress bars, while also avoiding repeated fetching of online translations.

Changes:

  • Parallelize extraction/formatting across admin-core, client, and proxy using Promise.all.
  • Add cli-progress multibar output + buffered console logging to keep progress rendering clean.
  • Fetch online translations once and reuse them for each component extraction.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
ui/scripts/extract-and-replace-translations.ts Parallelizes extraction, adds progress reporting, and reuses a single online-translation fetch.
ui/package.json Adds cli-progress and @types/cli-progress dependencies needed by the updated script.
ui/package-lock.json Locks the newly added cli-progress and @types/cli-progress dependencies.
Files not reviewed (1)
  • ui/package-lock.json: Generated file

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

Comment thread ui/scripts/extract-and-replace-translations.ts
Comment thread ui/scripts/extract-and-replace-translations.ts
Comment thread ui/scripts/extract-and-replace-translations.ts Outdated
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.

2 participants