question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The pipe 'translate' could not be found

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:15

github_iconTop GitHub Comments

18reactions
jcardozcommented, Dec 9, 2017

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.

  1. 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] }) ],

  2. 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]

9reactions
SamVerschuerencommented, Feb 15, 2017

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 import TranslateModule and it should work.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found