Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何使用内置i18n对innerHtml进行国际化_Angular_Internationalization_Angular I18n - Fatal编程技术网

Angular 如何使用内置i18n对innerHtml进行国际化

Angular 如何使用内置i18n对innerHtml进行国际化,angular,internationalization,angular-i18n,Angular,Internationalization,Angular I18n,因此,我正在进行一个项目,使用内置的i18n将一个web国际化 但很明显,在他们的代码中,他们使用innerHtml来显示警告,而我似乎无法在官方文档中找到将其国际化的方法 html使用以下函数获取innerHtml: 虽然ts看起来像这样: return ` By moving <strong>${this.movedSite.name || 'this site'}</strong> you will also be moving the $

因此,我正在进行一个项目,使用内置的i18n将一个web国际化

但很明显,在他们的代码中,他们使用innerHtml来显示警告,而我似乎无法在官方文档中找到将其国际化的方法

html使用以下函数获取innerHtml:

虽然ts看起来像这样:

return `
      By moving <strong>${this.movedSite.name || 'this site'}</strong> you will also be moving the
      ${sampleCount}
      ${activeJobCount}
      ${observationCount}
      linked to this site. Do you still want to move this site?
    `;
返回`
通过移动${this.movedSite.name | | this site'}您还将移动
${sampleCount}
${activeJobCount}
${observationCount}
链接到此网站。是否仍要移动此网站?
`;
有没有办法使用angular i18n翻译它?

在他们的文档中,他们说“为了本地化,您可以使用angular CLI生成为翻译人员创建文件所需的大部分样板文件,并以多种语言发布您的应用程序。”或者我可以推荐的另一种方法是使用ngx translate进行应用程序的本地化