zl程序教程

您现在的位置是:首页 >  前端

当前栏目

[Angular] Introduction to Angular Internationalization (i18n)

Angular to Introduction I18N
2023-09-14 09:00:49 时间

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.