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.

Translation not working when compiling with cordova

See original GitHub issue

I’m submitting a …

[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 Compiling in a ionic project make component not working. Some strings are completely missing (seems service return empty one) other are just resolved as the translation key (default behavior when translation is not found)

Reproduction of the problem I’ve just migrated from ng2-translate to ngx-translate. Both running correctly on browser. When i compile the ionic app for android the ngx-translate seems not working, as metioned before. Moving back to the ng2-translate the situation is resolved

  • ngx-translate version: 6.0.1

  • loader version: 0.03

  • Angular version: 2.4.8

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

22reactions
jcbowyercommented, Dec 25, 2017

I figured it out, i had to change my httploader to

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

Thanks

0reactions
aurelioscommented, Jul 30, 2021

I figured it out, i had to change my httploader to

export function HttpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

Thanks

thank you, worked for me with ionic + capacitor

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngx-translate not working on iOS device (Cordova)
I have a Cordova-based app (not ionic) which is deployed on android and iOS. Everything works fine except that my translations doesn't work...
Read more >
Windows Platform Guide - Apache Cordova
Windows Platform Guide. This guide shows how to set up your SDK development environment to build and deploy Cordova apps Windows 10 (Universal...
Read more >
How to translate in Ionic 5 - Internationalization and Localization
This post will explore the Ionic apps made in Angular Cordova, ... BUT, the translation does not work in places where you have...
Read more >
Setting up your development environment for the Moodle App
If you see this error in Ubuntu, run sudo apt-get install build-essential and retry. Current working directory is not a Cordova-based project.
Read more >
cordova-plugin-pgb-ios-localize-app-name - npm
It does not work on other Cordova platforms (Android, Windows, etc). It is only needed for users of build.phonegap.com (PhoneGap Build), ...
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