Questions tagged [ngx-translate]

NGX-Translate is a cutting-edge localization tool designed for Angular 2 and above. This powerful library enables users to effortlessly assign translations for their content in multiple languages and seamlessly switch between them with just a few clicks.

Learn the steps to translate conditional string interpolation with NGX-translate

My application has a toggle button that dynamically changes the label to either 'Enabled' or 'Disabled'. I am attempting to utilize ngx-translate for translation, but I am encountering difficulties in achieving this. Can anyone provide ...

Is there a way to convert my messages into different languages without relying on the 'translate' directive or pipe?

Currently, my Angular application is set up with ngx-translate for translation purposes. While it is currently monolingual, I am already looking ahead to the possibility of needing to translate it in the future. Everything is functioning perfectly, but I w ...

Internationalization of deferred-loaded modules within the JHipster application

I created My App using JHipster, which utilizes the JhiLanguageService in the ng-jhipster library. This service relies on the JhiConfigService to configure ngx-translate without requiring manual imports and configuration of the TranslateModule in my app.mo ...

Translation of menu item label has not been executed

Here we have a component called SidebarMenuComponent that is not translating the labels of its menu items correctly. The goal is to get the labels translated, but the current implementation is failing. What is the correct approach to apply translation in t ...

The ngx-translate Angular translation file is being loaded twice unnecessarily

Upon reviewing the network tab in the browser's developer tools, I discovered that my Angular app translation file is being loaded twice. Is there an issue with this? Should it be loading multiple times? https://i.stack.imgur.com/vcKm1.png ...

What is the best way to integrate ngx-translate's pipe for global translation?

I'm currently utilizing the ngx-translate package in order to internationalize my Angular application. When translating text using the translate pipe like so: {{ 'title' | translate }} An issue arises when attempting to use this pipe in other modules of ...

Having difficulty parsing the text into individual components found within the Feature modules

In my Shared module, I have a component that requires localization using NGX-TRANSLATE. However, it seems like the component in the shared module is not able to access the JSON file loaded in app.module.ts, resulting in the error: "Cannot read property 'De ...

Leverage the retrieved configuration within the forRoot function

Currently working on an Angular app that uses @ngx-translate. In my implementation, I am using TranslateModule.forRoot(...) to set up a TranslateLoader: @NgModule({ imports: [ TranslateModule.forRoot({ loader: { provide: TranslateLoade ...

Tips for utilizing functions in an inline HTML translation pipe

My objective is to streamline the code by using the Angular translate pipe. Currently, I find myself using 8 curly brackets and repeating the word "translate" twice... there must be a more efficient approach. Here is my current code setup: <s ...

Add a hash to the file name of the JSON translation asset

To prevent caching issues, I choose to store my translation files as JSON in /src/assets/i18n. To achieve this in Angular, I am looking for a way to add a unique fingerprint or hash to the filename of the file and use that hashed name when retrieving the ...

Trigger the browser to refresh translation files following the deployment

Our Angular/Ionic app utilizes the ngx-translate/core package for translations, and is hosted on Firebase. With each new build and deployment, Angular automatically creates a hash for our js files to ensure the browser fetches the latest version when chang ...

Retrieve information from the API following a change in language with Ngx-Translate

I am working on a web app using Angular 12 that supports 3 languages. To manage the languages, I have utilized Ngx-Translate. Overall, everything is functioning correctly, but I have encountered a small issue. I am using the onLangChange event emitter to ...

Can you explain the variances between ngx-translate and ngx-i18next for me?

As ngx-i18next serves as a wrapper for i18next, I am curious about the specific differences in translation capabilities between ngx-translate and i18next. ...

Saving selected language in Angular using ngx-translate

I am facing an issue with ngx-translate for translation. Whenever I select a language, it gets saved in localStorage. However, upon refreshing the page or navigating to another page, it reverts back to the default keys instead of the selected language. Be ...

Utilize ngx-translate with an array as interpolation values

When working with ngx-translate, I use the instant method to translate messages into the user's language. These messages are provided as JSON objects and some of them contain dynamic values: { "message.key": "First value is {{0}} and second ...