angular8.0 연구는 언어의 국제화 노트

1. 먼저 설치 NGX-번역 의존

NPM @의 설치 --save / 핵심 NGX를-번역 
NPM 설치 @ NGX-번역 / HTTP 로더 --save을

2. app.module.ts에 포함

수입 {TranslateModule, TranslateLoader}에서 '@ / 코어를 NGX-번역' ; 
수입에서 {TranslateHttpLoader} '@ / HTTP-로더를 NGX-번역';
수출 기능 createTranslateLoader (HTTP : HttpClient를) {
   반환   ( '.json을'HTTP '../assets/lang/'TranslateHttpLoader을 ); 
}

3. 국제 언어 구성 요소를 필요로하는 translateService의 도입;

자신의 요구를 JSON 나라를 저장하는 자산 디렉토리 폴더 4. 새로운 랭 파일;

 

어셈블리 서식 5. .app.component.html

 

추천

출처www.cnblogs.com/huangmin1992/p/10959414.html