Skip to content
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

fix(ivy): i18n - do not generate jsdoc comments for `$localize` #32473

Closed

Conversation

@petebacondarwin
Copy link
Member

commented Sep 4, 2019

Previously the compiler would generate the same jsdoc comment
block for $localize as for goog.getMsg(). But it turns out that
the closure compiler will complain if the @desc and @meaning
tags are used for non-getMsg() calls. So we now generate custom
jsdoc tags (@i18nDesc and @i18nMeaning) that for the
$localize calls.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Contributor

left a comment

LGTM 👍 I'll run g3 presubmit to see if Closure Compiler is happy :)

@AndrewKushnir

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2019

@AndrewKushnir

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2019

Closure Compiler still complains :(

comp.closure.js:107: ERROR - [JSC_BAD_JSDOC_ANNOTATION] Parse error. illegal use of unknown JSDoc tag "i"; ignoring it
     * @i18nDesc Label for a button
       ^

It looks like we can remove annotation for non-Closure case for now and re-assess the format as a next step, what do you think @petebacondarwin?

@petebacondarwin petebacondarwin force-pushed the petebacondarwin:i18n-jsdoc-comments branch from 0913616 to f8a9cf4 Sep 4, 2019
@AndrewKushnir

This comment has been minimized.

Copy link
Contributor

commented Sep 4, 2019

Previously the template compiler would generate the same jsdoc comment
block for `$localize` as for `goog.getMsg()`. But it turns out that
the closure compiler will complain if the `@desc` and `@meaning`
tags are used for non-`getMsg()` calls.

For now we do not generate the comments for `$localize` calls. They are
not being used at the moment.

In the future it would be good to be able to extract the descriptions and
meanings from the `$localize` calls rather than relying upon the `getMsg()`
calls, which we do now. So we need to find a workaround for this constraint.
@petebacondarwin petebacondarwin force-pushed the petebacondarwin:i18n-jsdoc-comments branch from f8a9cf4 to 8d858a4 Sep 4, 2019
@AndrewKushnir AndrewKushnir changed the title fix(ivy): i18n - generate `@i18n...` jsdoc comments fix(ivy): i18n - do not generate jsdoc comments for `$localize` Sep 4, 2019
@mhevery mhevery closed this in a731119 Sep 4, 2019
@petebacondarwin petebacondarwin deleted the petebacondarwin:i18n-jsdoc-comments branch Sep 5, 2019
sabeersulaiman added a commit to sabeersulaiman/angular that referenced this pull request Sep 6, 2019
…lar#32473)

Previously the template compiler would generate the same jsdoc comment
block for `$localize` as for `goog.getMsg()`. But it turns out that
the closure compiler will complain if the `@desc` and `@meaning`
tags are used for non-`getMsg()` calls.

For now we do not generate the comments for `$localize` calls. They are
not being used at the moment.

In the future it would be good to be able to extract the descriptions and
meanings from the `$localize` calls rather than relying upon the `getMsg()`
calls, which we do now. So we need to find a workaround for this constraint.

PR Close angular#32473
arnehoek added a commit to arnehoek/angular that referenced this pull request Sep 26, 2019
…lar#32473)

Previously the template compiler would generate the same jsdoc comment
block for `$localize` as for `goog.getMsg()`. But it turns out that
the closure compiler will complain if the `@desc` and `@meaning`
tags are used for non-`getMsg()` calls.

For now we do not generate the comments for `$localize` calls. They are
not being used at the moment.

In the future it would be good to be able to extract the descriptions and
meanings from the `$localize` calls rather than relying upon the `getMsg()`
calls, which we do now. So we need to find a workaround for this constraint.

PR Close angular#32473
@angular-automatic-lock-bot

This comment has been minimized.

Copy link

commented Oct 6, 2019

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 Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.