-
Notifications
You must be signed in to change notification settings - Fork 26.5k
feat(compiler-cli): add param to set MissingTranslationStrategy on ngc #15987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(compiler-cli): add param to set MissingTranslationStrategy on ngc #15987
Conversation
df2aedd
to
f8eb24e
Compare
packages/compiler-cli/src/codegen.ts
Outdated
} | ||
const {compiler: aotCompiler} = compiler.createAotCompiler(ngCompilerHost, { | ||
translations: transContent, | ||
i18nFormat: cliOptions.i18nFormat, | ||
locale: cliOptions.locale, | ||
missingTranslation: missingTranslation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missingTranslation
packages/compiler-cli/src/codegen.ts
Outdated
break; | ||
case 'ignore': | ||
missingTranslation = MissingTranslationStrategy.Ignore; | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default
-> error unknown option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments + rebase needed
a82feb0
to
8046c52
Compare
8046c52
to
15d26ae
Compare
packages/compiler-cli/src/codegen.ts
Outdated
} | ||
transContent = readFileSync(cliOptions.i18nFile, 'utf8'); | ||
} | ||
let missingTranslation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init with the default MissingTranslationStrategy.Ignore
This commit adds a new parameter to ngc named `missingTranslation` to set the MissingTranslationStrategy for AoT, it takes the value `error`, `warning` or `ignore`. Fixes angular#15808
15d26ae
to
409a107
Compare
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular#15987 and that let's you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that let's you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This will go in in v4.0-beta.0 since v4.1 is no longer accepting features. |
You mean 4.2 beta 0? Not a problem, it's not a very important feature |
yes, that is what I meant. |
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
angular#15987) This commit adds a new parameter to ngc named `missingTranslation` to set the MissingTranslationStrategy for AoT, it takes the value `error`, `warning` or `ignore`. Fixes angular#15808 PR Close angular#15987
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
angular#15987) This commit adds a new parameter to ngc named `missingTranslation` to set the MissingTranslationStrategy for AoT, it takes the value `error`, `warning` or `ignore`. Fixes angular#15808 PR Close angular#15987
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
What kind of change does this PR introduce?
What is the current behavior?
See issue #15808. We were unable to set the MissingTranslationStrategy for AOT (it only worked in JIT) because of a recent refactoring of the functionality.
What is the new behavior?
Added a new cli parameter
missingTranslation
for ngc that you can use to set the MissingTranslationStrategy. It takes the valueserror
,warning
orignore
. The internal APIs still use the enum MissingTranslationStrategy (the string parameters are converted to numbers, for consistency).Does this PR introduce a breaking change?
Other information:
I didn't add any test yet, not really sure how to test this?