You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ng xi18n isn't extracting localized messages when using $localize inside component ts files #16375
Using localize directly is not currently supported by the framework. However, it is being evaluated for future inclusion within the framework. But for 9.0, the attribute usage is the recommended and supported localization method.
The plan is to release a new message "extractor" for 9.1.0 - there is already a PR in the works here angular/angular#32912
In the meantime (for 9.0.0) you can assume that $localize is an internal implementation thingy.
That being said, you can still use $localize in your application code, it is just that you would have to work out the message id from the warnings that you get during translation. (Just don't tell anyone I said that)
Activity
clydin commentedon Dec 6, 2019
Using localize directly is not currently supported by the framework. However, it is being evaluated for future inclusion within the framework. But for 9.0, the attribute usage is the recommended and supported localization method.
josuerios commentedon Dec 6, 2019
Thanks for the info @clydin. Are there any plans for including it in a minor release of 9.x?
petebacondarwin commentedon Dec 6, 2019
The plan is to release a new message "extractor" for 9.1.0 - there is already a PR in the works here angular/angular#32912
In the meantime (for 9.0.0) you can assume that
$localizeis an internal implementation thingy.That being said, you can still use
$localizein your application code, it is just that you would have to work out the message id from the warnings that you get during translation. (Just don't tell anyone I said that)josuerios commentedon Dec 6, 2019
Good news! Thanks @petebacondarwin, I'll close this issue now.
mstawick commentedon Jan 2, 2020
If someone bumps into this issue, this might be helpful.
What I did is I've created a
TranslationComponent, in which I'll declare all the code translations, ex.:<span i18n>Some translation</span>Then when in code I write:
everything works "out of the box" because ID is the same.
angular-automatic-lock-bot commentedon Feb 2, 2020
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.