Reputation: 51
I am trying to migrate from ngx-translate to Angular i18n approach and wanted to make sure a few points before migration.
ng-tranlate
package?Thanks in advance!
Upvotes: 5
Views: 1878
Reputation: 972
You can find the corresponding gitlab issue here. There is still no milestone set to it, so I guess it will take some more time for this feature to be implemented.
For those who are looking for a possible workaround to get translations inside Angular 7- components: I personally use the following workaround, which you also can find together with some other proposals in the gitlab issue:
Create hidden elements in the template
<span style="display: none;" #trans-foo i18n>foo</span>
Bind them using
@ViewChild('trans-foo') transFoo : ElementRef;
Then retrieve the translated value
transFoo.nativeElement.textContent
Upvotes: 2