[Angular] Introduction to Angular Internationalization (i18n)

To add translation to the application:

<button (click)="onEditCourse()" i18n>Edit button</button>

'i18n' is for Angular CLI to extract all the string which need to be translated.

Run:

ng xi18n

It will generate messages.xif, this file will be sent to the translator interface, then we can add translation for the application.

It is possible to provide custom message, description or even id for the translation, but it is not recommended.

猜你喜欢

转载自www.cnblogs.com/Answer1215/p/10353818.html