Skip to content

fix(i18n): emit manifest strings from config in standalone extract#961

Merged
kabaros merged 1 commit into
masterfrom
fix/i18n-extract-manifest-strings
Jun 15, 2026
Merged

fix(i18n): emit manifest strings from config in standalone extract#961
kabaros merged 1 commit into
masterfrom
fix/i18n-extract-manifest-strings

Conversation

@HendrikThePendric

@HendrikThePendric HendrikThePendric commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Problem

d2-app-scripts i18n extract produced a different i18n/en.pot than build and start, because it dropped the __MANIFEST_APP_* / __MANIFEST_SHORTCUT_* strings.

All three call extract(), which only emitted those strings inside if (isApp). build and start passed isApp; the standalone i18n command didn't.

Fix

extract() now decides from the config it already parses — emitting the manifest strings when config.entryPoints?.app is present — instead of a caller-supplied flag. The redundant isApp argument is removed from extract and its call sites. All three paths now emit the same strings.

Tests

Added src/lib/i18n/extract.test.js: manifest strings are emitted iff the config has an app entry point.

🤖 Generated with Claude Code

fixes https://dhis2.atlassian.net/browse/LIBS-828

The standalone `d2-app-scripts i18n extract` command produced a different
`i18n/en.pot` than `build` and `start`, because it omitted the
`__MANIFEST_APP_*` / `__MANIFEST_SHORTCUT_*` translation strings.

All three paths call `extract()`, which only emitted those manifest strings
inside an `if (isApp)` block. `build` and `start` passed `isApp`;
`commands/i18n.js` did not, so the CLI command dropped them.

Decide whether to emit the manifest strings from the parsed config instead of
a caller-supplied flag: emit them when `config.entryPoints?.app` is present.
This removes the now-redundant `isApp` argument from `extract` and its call
sites, so all three paths emit the same strings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@HendrikThePendric HendrikThePendric self-assigned this Jun 12, 2026
@kabaros kabaros merged commit 5562b0f into master Jun 15, 2026
24 checks passed
@kabaros kabaros deleted the fix/i18n-extract-manifest-strings branch June 15, 2026 07:37
dhis2-bot added a commit that referenced this pull request Jun 15, 2026
## [12.11.3](v12.11.2...v12.11.3) (2026-06-15)

### Bug Fixes

* **i18n:** emit manifest strings from config in standalone extract ([#961](#961)) ([5562b0f](5562b0f))
@dhis2-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 12.11.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants