Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The localize step for federation artifacts ignores the project's
i18nMissingTranslationsetting.translateFederationArtifactsrunslocalize-translatewithout-m/--missingTranslation, so the CLI always uses its default ofwarning.So
"i18nMissingTranslation": "ignore"or"error"only affects Angular's own bundles, not the federation artifacts:"ignore", every missing translation is still printed as a warning"error", the federation step doesn't failThis is more than noise in large apps with many missing translations across several locales. The warnings are captured by
execFileSync, and once they exceed its default 1 MBmaxBuffer, the build fails:Change
translateFederationArtifactstakes an optionalmissingTranslationparameter, typed asApplicationBuilderOptions['i18nMissingTranslation'], and passes it tolocalize-translateas-m. When it's unset, it defaults towarning, Angular's default, so behavior doesn't change for projects that don't set the option.builder.ts(the build path and the watch rebuild) passngBuilderOptions.i18nMissingTranslation.Tests
i18n.spec.ts:-mgets each oferror,warningandignore, and defaults towarningwhen the option isn't set.i18n.integration.spec.ts: with the real CLI, a missing translation fails the run undererrorand passes underignore.Verification
pnpm typecheckandpnpm lintpass, with no new warnings.pnpm test: the new tests pass. I ran it on Windows, where 34 specs already fail onmain, including 3 ini18n.spec.ts, because they expect POSIX paths. This PR doesn't add any failures.v22.2.4and ran it against a real app with 5 locales. Withi18nMissingTranslation: "ignore", the localized production build went fromENOBUFSto a clean build with all locale folders written.Not included
With
warning(the default), enough warnings can still overflowmaxBuffer. A follow-up could stream the CLI's stderr instead of buffering it. It's kept separate so this PR stays focused.Generated with Claude Code