The pipe 'translate' could not be found
See original GitHub issueI’m submitting a … (check one with “x”)
[ x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request
Current behavior Translate does not work on the child components
Expected/desired behavior Translate does not work on the child components
Reproduction of the problem I am using translation pipe on the home page it works fine, but when i add it on the child component , it says The pipe ‘translate’ could not be found
I looked at this issue,
https://github.com/ngx-translate/core/issues/163
but when i import
{provide: PLATFORM_PIPES, useValue: TranslatePipe, multi: true}`
it is not supported with the angular version. How can i solve this issue?
Please tell us about your environment:
-
**ngx-translate version:**5.0.0
-
Angular version: 2.4.0
-
Browser: [all | Chrome XX
Issue Analytics
- State:
- Created 7 years ago
- Comments:15
Top Results From Across the Web
Angular translate Pipe could not be found - Stack Overflow
If you work with newer versions of angular and ngx-translate , if you have 'Use legacy View Engine' checked in settings, then vs...
Read more >Error: The pipe 'translate' could not be found! #1261 - GitHub
This might happen because of missing dependency injection for ngx-translate service. import { TranslateService } from "@ngx-translate/core";.
Read more >NG0302: The pipe 'translate' could not be found! - Ionic Forum
Hi everyone. I have a strange issue with translate module. I try to describe the scenario: Main page ClubSettingsMenuComponent (it is a ...
Read more >Fix Ngx-translate pipe not found in Angular 11 error [solved]
This error occurs in strict typescript in Angular 11 when using the ngx-translate functionality. In this case I use a core module (which...
Read more >NG0302: Pipe not found! - Angular
Angular can't find a pipe with this name. The pipe referenced in the template has not been named or declared properly. In order...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those coming across the pipe translate could not be found, here are the steps you need to do in a nutshell to fix the issue when using in a different module.
Have the translate module logic along with translate loader and translateFactory present in the app.module.ts
TranslateModule.forRoot({ provide: TranslateLoader, useFactory: (http: Http) => new TranslateStaticLoader(http, './assets/i18n', '.json'), deps: [Http] }) ],
In your shared.module.ts (or any other module), import and export the Translate module. i.e.: Translate module should be a part of both the import and export arrays. Most answers in SO and github mention importing the module but not exporting it.
@NgModule({ imports: [ TranslateModule ], exports: [ TranslateModule]
Just keep app module with what you have. It configures
ngx-translate
and sets up all the services which is fine. And then in your sub-module, just importTranslateModule
and it should work.