简体   繁体   English

Angular 7 i18n 支持翻译 typescript 文件

[英]Angular 7 i18n support translate typescript file

Versions.版本。

"@angular-devkit/build-angular": "0.13.4",
"@angular-devkit/build-ng-packagr": "0.13.4",
"@angular/animations": "7.2.2",
"@angular/cdk": "7.2.2",
"@angular/cli": "7.3.3",
"@angular/common": "7.2.6",
"@angular/compiler": "7.2.6",
"@angular/compiler-cli": "7.2.6",
"@angular/core": "7.2.6",
"@angular/forms": "7.2.6",
"@angular/language-service": "7.2.6",
"@angular/material": "7.2.2",
"@angular/platform-browser": "7.2.6",
"@angular/platform-browser-dynamic": "7.2.6",
"@angular/router": "7.2.6",

This is a support request: I started internationalizing my application, and I met the following problem: when generating the bundle for the Japanese locale (for example), with using i18n for.html file perfectly used but i can not using with.ts file.这是一个支持请求:我开始国际化我的应用程序,但遇到了以下问题:当为日语语言环境生成捆绑包时(例如),使用 i18n for.html 文件完美使用,但我不能使用 with.ts 文件. As far as I find out there are two ways, ngx-translate and @angular/localize.据我所知,有两种方法,ngx-translate 和@angular/localize。

Ngx-translate not suitable for my project, @angular/localize using start with angular 9 but i using angular 7. Ngx-translate 不适合我的项目,@angular/localize 使用从 angular 9 开始,但我使用 angular 7。

Is there any way translate typescript file with angular 7?有没有办法用 angular 7 翻译 typescript 文件? Or do I really have to upgrade to angular 9 to use @angular/localize还是我真的必须升级到 angular 9 才能使用 @angular/localize

Unfortunately yes.不幸的是。

The versions of the angular packages proceed the same as the main repo. angular 软件包的版本与主存储库相同。 The oldest version of the @angular/localize package goes back to 9.1.13. @angular/localize package 的最旧版本可以追溯到 9.1.13。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM