Angular 9: i18n in TypeScript
问题 I studied the new i18n feature in Angular 9. https://angular.io/guide/i18n How to translate text in TypeScript, e.g. SnackBar messages? 回答1: Check this blog https://blog.ninja-squad.com/2019/12/10/angular-localize/ @Component({ template: '{{ title }}' }) export class HomeComponent { title = $localize`You have 10 users`; } And You have to manually add it to your messages.fr.xlf <trans-unit id="6480943972743237078"> <source>You have 10 users</source> <target>Vous avez 10 utilisateurs</target> <