Skip to content

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

Conversation

ocombe
Copy link
Contributor

@ocombe ocombe commented Apr 14, 2017

What kind of change does this PR introduce?

[x] Bugfix
[x] Feature

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 values error, warning or ignore. The internal APIs still use the enum MissingTranslationStrategy (the string parameters are converted to numbers, for consistency).

Does this PR introduce a breaking change?

[x] No

Other information:
I didn't add any test yet, not really sure how to test this?

@ocombe ocombe added area: i18n Issues related to localization and internationalization action: discuss state: WIP labels Apr 14, 2017
@ocombe ocombe requested a review from vicb April 14, 2017 13:22
@ocombe ocombe force-pushed the fix-missing-translation-strategy-aot-15808 branch 5 times, most recently from df2aedd to f8eb24e Compare April 17, 2017 09:01
@ocombe ocombe added action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: discuss state: WIP labels Apr 19, 2017
}
const {compiler: aotCompiler} = compiler.createAotCompiler(ngCompilerHost, {
translations: transContent,
i18nFormat: cliOptions.i18nFormat,
locale: cliOptions.locale,
missingTranslation: missingTranslation,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missingTranslation

break;
case 'ignore':
missingTranslation = MissingTranslationStrategy.Ignore;
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default-> error unknown option

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

vicb
vicb previously requested changes Apr 19, 2017
Copy link
Contributor

@vicb vicb left a 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

@ocombe ocombe force-pushed the fix-missing-translation-strategy-aot-15808 branch 4 times, most recently from a82feb0 to 8046c52 Compare April 20, 2017 09:48
@ocombe ocombe removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 20, 2017
@ocombe ocombe force-pushed the fix-missing-translation-strategy-aot-15808 branch from 8046c52 to 15d26ae Compare April 20, 2017 10:19
}
transContent = readFileSync(cliOptions.i18nFile, 'utf8');
}
let missingTranslation;
Copy link
Contributor

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
@ocombe ocombe force-pushed the fix-missing-translation-strategy-aot-15808 branch from 15d26ae to 409a107 Compare April 20, 2017 21:28
@ocombe ocombe added the action: merge The PR is ready for merge by the caretaker label Apr 21, 2017
ocombe added a commit to ocombe/angular-cli that referenced this pull request Apr 24, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular#15987 and that let's you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request Apr 24, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that let's you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request Apr 24, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
@mhevery
Copy link
Contributor

mhevery commented Apr 24, 2017

This will go in in v4.0-beta.0 since v4.1 is no longer accepting features.

@ocombe
Copy link
Contributor Author

ocombe commented Apr 24, 2017

You mean 4.2 beta 0? Not a problem, it's not a very important feature

@mhevery
Copy link
Contributor

mhevery commented Apr 24, 2017

yes, that is what I meant.

@mhevery mhevery closed this in 6e2abcd Apr 28, 2017
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request May 9, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
@ocombe ocombe deleted the fix-missing-translation-strategy-aot-15808 branch June 8, 2017 08:20
ocombe added a commit to ocombe/angular-cli that referenced this pull request Jul 20, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
ocombe added a commit to ocombe/angular-cli that referenced this pull request Jul 27, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
asnowwolf pushed a commit to asnowwolf/angular that referenced this pull request Aug 11, 2017
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
hansl pushed a commit to angular/angular-cli that referenced this pull request Aug 18, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
hansl pushed a commit to angular/angular-cli that referenced this pull request Aug 18, 2017
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
juleskremer pushed a commit to juleskremer/angular that referenced this pull request Aug 28, 2017
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
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this pull request Apr 23, 2018
This adds the new parameter `missingTranslation` for AoT that was added in angular/angular/pull/15987 and that lets you define the MissingTranslationStrategy
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: i18n Issues related to localization and internationalization cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants