Đặt câu hỏi và nhận tóm tắt tài liệu bằng cách tham chiếu trang này và nhà cung cấp AI bạn chọn
Lịch sử phiên bản
- "Init history"v9.0.013/6/2026
Nội dung của trang này đã được dịch bằng AI.
Xem phiên bản mới nhất của nội dung gốc bằng tiếng AnhIf you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
Migrate from NGX-Translate to Intlayer
Migrating your Angular application from ngx-translate to Intlayer is easy with the compat adapter, allowing you to bypass the need to rewrite all your templates.
What to do
Begin by running:
Sao chép mã vào clipboard
npx intlayer initThis sets up the intlayer.config.ts. Replace your TranslateModule.forRoot() setups and import aliases appropriately to point to @intlayer/ngx-translate.
What it does under the hood
ngx-translate uses TranslateService (instant, get, stream) alongside the {{ 'KEY' | translate:params }} pipe and the [translate] directive.
Under the hood:
- Services:
TranslateServicewrapsgetIntlayerand a locale observable, providing exactly the same methods. - Pipes & Directives: Re-implemented to resolve against Intlayer dictionaries directly.
- Loaders:
TranslateHttpLoadersetups are converted to warning stubs because Intlayer inherently resolves and bundles your dictionaries at build time (or through standard dynamic imports), completely eliminating the need for HTTP loaders.