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.

Using TranslateService in a provider is not working

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 Does not find the TranslateService…

Reproduction of the problem

Add a provider, import TranslateService and add it to the constructor… says “The name “TranslateService” cannot be found.”

What is the expected behavior?

Please tell us about your environment:

cordova CLI: 6.5.0
Ionic Framework Version: 2.1.0-201703061537
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.3
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:24

github_iconTop GitHub Comments

5reactions
samanmohamadicommented, Nov 23, 2017

Calling getTranslation before get resolves the issue.

3reactions
SamVerschuerencommented, Mar 9, 2017

Make sure to use service.use ('nl'); somewhere at the start of you application. Then you will get the correct values.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Translate service not working on load page - Stack Overflow
I have a very strange behaviour when using translate service. I configure the translator like this : export class AppComponent implements ...
Read more >
Angular I18n: How to Internationalize with ngx-translate | Phrase
Fetching a translation key in TypeScript files. The get() function of TranslateService is used to fetch the translated value of a key in...
Read more >
ngx-translate Documentation - CodeAndWeb
Covers: TranslateService API, Translate Pipe & Directive. ... This does of course not work with dynamically created IDs like the one above.
Read more >
Top 5 @ngx-translate/core Code Examples - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... getTranslate = function () {...
Read more >
Doc: Guide - Angular Translate
Declarative templates with data-binding, MVC, dependency injection and great testability ... Asynchronous loading of i18n data; Pluralization support using ...
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