Questions tagged [ngx-translate]

NGX-Translate is an internationalization library for Angular 2+. It lets you define translations for your content in different languages and switch between them easily.

Resources:

  1. Website: http://www.ngx-translate.com/
  2. Github: https://github.com/ngx-translate
  3. Demo: https://stackblitz.com/github/ngx-translate/example
716 questions
8
votes
2 answers

Get NGX translate to work in a NX workspace lib

I'm trying to get translations work for both the app components and the lib components. For now I can only get app or lib components to work, but not at the same time. Structure: Created an ionic app with a home component Created a "features/ui"…
Michael Winther
  • 471
  • 7
  • 24
8
votes
2 answers

Angular6 - load translations using API call to backend using ngx-translate

I want to use ngx-translate in my frontend to dynamically load translations on app load. My backend returns a response in JSON format, ex: { "something: "something" } I want to use that output on my TranslateLoader instead of a local en.json…
jdoe1010
  • 103
  • 1
  • 1
  • 5
8
votes
3 answers

Using routes for links in ngx-translate

I´m using Angular 5 with ngx-translate for i18n. Now I´ve the following issue and found no solution so far: Template: Please Signup now! Now this string should be translated via the translation json files. But routerlink…
Michael
  • 2,966
  • 3
  • 30
  • 33
8
votes
0 answers

How to 'npm link' Angular library with a shared library?

For my Angular 4.x application (App) I wrote a library (e.g 'Lib') which is currently not AoT compatible. Both App and Lib depend on a 3rd party library (e.g. 'X'). When I use “npm link” to develop Lib in App, some things stop working since X is…
7
votes
3 answers

Angular Circular dependency when inject TranslateService to interceptor

I have a problem with injecting dependencies into the interceptor. I want to inject TranslateService into HttpErrorInterceptor, but I get a cyclic dependency error. When I remove the TranslateService injection it all works. I have declared…
lukasbear
  • 121
  • 1
  • 5
7
votes
6 answers

Angular 7 prod build i18n files not found

I am trying to deploy an Angular 7 app that uses ngx-translate and translated language files in the /dist/assets folder. I specified the correct base href in build. After deployment, I see everything loads, except the languages file which returns an…
npabs18
  • 167
  • 2
  • 10
7
votes
3 answers

The pipe 'translate' could not be found error is showing In Ionic 4

I am working in my Ionic 4 App and I have installed the ngx-translate plugin. It is working fine in app.component.html but in tabs.page.html it is showing the error. The pipe 'translate' could not be found This is my app.component.html:
Rahul Pamnani
  • 1,397
  • 5
  • 26
  • 66
7
votes
6 answers

ngx-translate is not working for lazy loaded module

I want to implement ngx-translate in angular 5 project lazy loaded module wise its working for only parent module but not works in my child module so please suggest better solution. I write my code for app module . and i am using @ngx-translate/core…
vishnu
  • 71
  • 1
  • 1
  • 3
7
votes
4 answers

Angular ngx-translate getTranslation issue

I am using ngx-translate to translate my Angular Web-app, and it seems that ngx-translate has an issue with the function getTranslation(language). When it's called, it changes the current language ?temporarly? and then my component is not displayed…
Mattew Eon
  • 1,722
  • 1
  • 21
  • 38
7
votes
2 answers

ngx-translate: Translate string in Unit Testing

I can get the value if it's a static test, but whenever I'm trying to get the translated value (using ngx-translate), it's empty.

{{ 'MENU_TITLE' | translate | uppercase }}

This works and returns…
Greg
  • 1,382
  • 3
  • 22
  • 45
7
votes
1 answer

ngx-translate innerHTML styling

I using Angular 5.0.1 and ngx-translate/core 8.0.0 I have this code in template

and this string in en.json "privacyAgree": "Clicking «Registration» button, I acceptthe…
Ruslan
  • 108
  • 2
  • 8
7
votes
1 answer

ngx/translate - translate only part of a string

I need to translate strings coming from a server using ngx/translate. It works fine when i need to translate a string but in some case i need to translate only part of the string. For example: 'hello Shay' or 'hello John' And i need to translate…
Shay
  • 407
  • 2
  • 8
  • 15
7
votes
0 answers

Use ngx-translate in a multi-module Angular setup and child-libraries

I am using ngx-translate for translation in my Angular app. It works just fine with a simple project setup, but we develop a large-scale business application and different components are split into several seperate libraries. Some of the libraries…
tommueller
  • 2,358
  • 2
  • 32
  • 44
6
votes
1 answer

Can not start Angular Website after @ngx-translate Installation

I have installed @ngx-translate/core Version 14.0.0 and @ngx-translate/http-loader Version ^7.0.0 in my Application and followed a few tutorials (eg. this) on how to add Multiple Languages to an Angular Site. My Angular Version is 11.2.10. After…
davidemarcoli
  • 63
  • 1
  • 5
6
votes
1 answer

Is there a way to translate css selectors(::after, ::before) content using ngx-translate?

Is there a way to translate css selectors(::after, ::before) content using ngx-translate ? .custom-file-label::after { content: "Browse" }
1 2
3
47 48