270 questions
0
votes
0
answers
32
views
How can I find a translatable string by ID?
In the messages file of my multilingual Angular project, I have strings that only contain {$INTERPOLATION} and nothing else. These obviously don't need to be translated. They are mistakes, where there ...
0
votes
1
answer
170
views
How do I build a single language version of an Angular application localized with Angular i18n
I am localizing an Angular application using the Angular i18n package.
The original language is German, and I am creating an English version.
On building the application, I get two subdirectories &...
1
vote
1
answer
146
views
Modern Angular i18n - how to set MissingTranslationStrategy?
I would like to disable the warnings at runtime when no translation is found for Angular i18n because there are usually a lot of warnings until we get around to a translation update.
There is a ...
1
vote
1
answer
81
views
Angular 18 localize text in environment file
I am using @angular/localize to localize my angular application. How can I localize text from different environment files like environment.ts, environment.development.ts, environment.qa.ts?
for prod
...
0
votes
1
answer
271
views
Change the Angular app language dynamically using @angular/localize
I use @angular/localize to localize my Angular app. Is there a way to change the app locale dynamically; for example by using a dropdown button? I am fine with reloading the page when the locale is ...
1
vote
1
answer
1k
views
Whats the best approach to set LOCALE_ID in an i18n SSR Angular 19 app?
Whats the best approach to set LOCALE_ID in an i18n SSR Angular 19 app?
I can set it on the server (app.server.config.ts) by setting this DI token:
{
provide: LOCALE_ID,
useFactory: () => {
...
2
votes
1
answer
2k
views
Issues Configuring Internationalization (i18n) in Angular 19
I am working on an Angular 19 project, and I'm trying to add internationalization (i18n) features to support multiple languages. I've followed several guides and suggestions, but I keep running into ...
3
votes
0
answers
214
views
how to translate routes on angular 18 with built-in i18n
I'm building an Angular 18 application and need to implement routing with language-specific paths. I want to use Angular's built-in i18n (internationalization) features to translate route paths based ...
1
vote
1
answer
499
views
Assets dont load when angular app is localized
i am trying to create a website for myself where one can change the language. I followed the Angular's documentation on locales (link) step by step. I marked my HTML elements with the i18n tag, ...
0
votes
1
answer
470
views
i want change the locale for a particular component/current component
I'm working on an Angular 17 application where I've implemented i18n for internationalization. Initially, I've set Arabic as the default language for the entire application. Now, I need to switch to ...
1
vote
0
answers
94
views
build localized variant applications using ngx-translate (migrate ngx-translate to angular i18n)
So currently our Angular project uses the ngx-translate package to internationalize it.
we have the directory src/assets/i18n/ containns ws-en.json, ws-fr.json and ws-de.json
The problem: I want to ...
0
votes
1
answer
255
views
i18n generates xlf with whitespace in source tag for Angular code
I am using i18n for localization in my Angular project. I came to an issue where there are duplicate text entries but with different spacing (whitespaces at the beginning/end of the string.
<...
0
votes
5
answers
3k
views
Why doesn't Angular i18n work properly in my project?
I am implementing an i18n for a personal project which uses Atomic Design for components. So far I haven't encountered any problems (and I am pretty new to Angular), but for the last couple of days I'...
0
votes
1
answer
126
views
Hiding en/es from URL of IIS-hosted Angular 16 web app with i18n enabled
I have an Angular 16 web app. Users access it like this: www.myapp.com or www.myapp.com/workspace or www.myapp.com/data/members etc. The web app is hosted in IIS (Azure App Service). Everything works ...
1
vote
0
answers
171
views
Is there a way to reroute users to different locale builds in Angular (using Vercel)?
I use Angular's internationalization and localization. I have my project on three different languages: English, Georgian and Russian. This is my i18n configuration in angular.json
"i18n": {
...
1
vote
1
answer
696
views
How to properly deploy an Angular i18n app on Azure Static Web Application?
I have things mostly working, but this staticwebapp.config.json is causing me more trouble than a typical nginx or apache configuration.
This is an Angular 15 Application with i18n configured.
My ...
0
votes
0
answers
523
views
ngx-translate custom loader in angular library is overriden by host app loader
Context:
I'm trying to use ngx-translate in an angular library, and because I want to the library to use the assets of the library in the dist/ folder by default instead of hosting app assets, so I ...
1
vote
1
answer
361
views
Type 'Observable<string> | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'
I was trying to translate a text in ts file using ngx-translate, but could not convert Observable to string data type.
I tried using this methods.
this.endSession = this.translate.stream('sessions-...
0
votes
1
answer
631
views
Angular Universal with i18n served locally: Failed to load module script
I'm trying to make my Angular universal app (version 15.1.0) run locally with i18n. I keep getting the following error though:
Failed to load module script: Expected a JavaScript module script but ...
2
votes
0
answers
276
views
Should I use firebase hosting redirects, rewrites or something else for my Angular internationalized versions of the application?
I am using Firebase to host my Angular app and recently I started migrating from ngx-translate to the angular way of i18n which is translation on build time. This creates a problem with the app ...
0
votes
0
answers
51
views
When using i18n in Angular 15, what is the process for keeping updated messages.{locale}.xlf files over time? [duplicate]
I have setup Internationalization and Localization for my project for two languages. The process was pretty straight forward, but I'm hung up on how the process should exist for making markup or copy ...
0
votes
0
answers
314
views
Pluralization in Angular i18next
I am trying to display the no. of devices on the page using i18next.
The goal is to show the following text depending on the number of devices:
if count = 0 | "vCenters"
if count = 1 | &...
0
votes
2
answers
746
views
How to write i18n for ternary expression in Angular
I need to internationalize a ternary expression with i18n in Angular. How to do this?
<ion-title i18n>{{currentStep === 0 ? 'New chat' : 'New room'}}</ion-title>
3
votes
0
answers
351
views
Using Angular built-in i18n with Capacitor
Now we have an application which uses Angular built-in i18n for multi-lingual app and with using Angular built-in i18n there is a separate build for each language. We will use Capacitor as a hybrid ...
1
vote
1
answer
871
views
How to translate an @Input with i18n in Angular?
I have a component with a custom input, which I call like this:
<app-button [color]="'black'"
[label]="'Manage'"
></app-button>
I want to translate the ...
0
votes
1
answer
889
views
How to prevent rule `@angular-eslint/template/i18n` from linting `mat-icon` elements
I use the rule @angular-eslint/template/i18n to lint elements in template that contains text node and doesn't have an i18n attribute.
The Angular Material mat-icon elements use inner text to identify ...
0
votes
1
answer
3k
views
Angular i18n $localize - template literal with expressions
I am having so much trouble getting this syntax to translate - Angular 13.0.02 .
My two resources are:
https://angular.io/api/localize/init/$localize
https://lokalise.com/blog/angular-i18n/
As per ...
4
votes
0
answers
633
views
@angular/localize: How to use interpolation in templates?
I'm using @angular/localize to translate labels in my application.
Say this is my translation file:
{
"locale": "en-US",
"translations": {
"...
0
votes
2
answers
585
views
Angular Localization Issue with EJ2 Syncfusion
I m working on the Syncfusion Spreadsheet component to play data like an excel. I implemented all necessary things with Syncfusion documents. But I have an issue in there. I m trying to format numbers ...
2
votes
1
answer
825
views
Angular i18n $localize function doesn't return source language term
Running our application with the Spanish LOCALE_ID ("es"), I can dynamically pull a translation term and then render a toaster type message as follows:
const message = $localize`:Toastr ...
1
vote
0
answers
249
views
Angular 13 i18n switches to en-US when I try to access some of the routes in the other language
I hosted my angular 13 website on Github Pages and after I added i18n I have the following routing problem.
When I go to https://MyRepoName.github.io/base/en-US/ everything is fine and I get ...
0
votes
1
answer
339
views
TS file in Angular app: how to translate text from toastlify with i18next & angular-i18next?
I've got all my application running with i18next and angular-i18next for internationalization.
I would like to translate a pop up using angular-toastify but the code that must be translated is into a ...
3
votes
1
answer
994
views
Angular Internationalization Interpolated Strings
I am not sure how to do a translation for a dynamic variable in my app.
Currently, I have the report descriptions in a static json file. I am looping through the content of that and using string ...
0
votes
1
answer
429
views
Angular localize: is source message text required?
I have in my .html file something like
<mat-form-field>
<mat-label i18n="@@title">Title</mat-label>
<input matInput formControlName="title" ...
2
votes
1
answer
2k
views
Angular 13 dynamic locale change
To localize my Angular 13 application I followed the official guide: https://angular.io/guide/i18n-example, created *.xlf files with translations, everything seems to work fine so far.
Now, I wonder ...
1
vote
0
answers
193
views
Is there a way to load static language files and also be able to load additional language resource on-demand using ngx-translator?
My application has static JSON files for most translations, but some run time data also has translations and I'd like to load that translation data on-demand using ngx-translator.
Is there a way to ...
8
votes
4
answers
11k
views
is runtime language translation possible with angular (@angular/localize)?
I am trying to learn and add Angular Internationalization in a project.
I can understand only compile time translation from angular documents (https://angular.io/guide/i18n-overview).
I need some ...
1
vote
2
answers
2k
views
Angular Universal SSR with i18n not loading locale from server side
I am using i18n with Angular Universal SSR. The issue is that the client received the text in source locale and after a few seconds are replaced with the correcty locale.
For example, client load http:...
6
votes
1
answer
3k
views
How to use anguluar i18n in html template with variables?
Is it possible to use variables in an angular template i18n string?
In TypeScript I can use template string, eg:
public welcomeMessage = $localize`:@@test.welcome: Hello ${this.name}:user_name:! How's ...
2
votes
1
answer
1k
views
How to escape curly braces in Angular's $localize function?
If i try to translate the following text:
{example}
like this:
$localize`{example}`
The text will disappear in the translated build.
Is there a way to escape the curly braces?
0
votes
0
answers
262
views
How to localize content coming from third party libraries in Angular
I am using multiple libraries in my angular application. I want to understand how I can localize contents coming from these libraries or is there a way to load their translation files in the ...
0
votes
1
answer
941
views
How to use angular ngx-translate pipe in ngx-charts?
I want to add pipeline to my ngx-chart xAxisLabel and yAxisLabel.
<ngx-charts-bar-vertical
[view]="view"
[scheme]="colorScheme"
[...
4
votes
1
answer
563
views
Firebase i18n rewrite language-override cookie is ignored
I localized an Angular App with the standard Angular localize package. That works perfect and I host my app on firebase. I read the firebase article on how to configure i18n rewrites and implemented ...
5
votes
1
answer
5k
views
Angular $localize is not a function
I've got a strange error trying to use $localize in my ts files. I am getting this error
Error: Uncaught (in promise): TypeError: angular_localize_init__WEBPACK_IMPORTED_MODULE_3_.$localize is not a ...
-1
votes
2
answers
2k
views
Angular i18n: Get all locales at runtime
I have an app that is localized using angular-i18n to which I want to add a language switch button. This is working, however, the available languages are hard-coded, i.e. I have to specify the ...
1
vote
1
answer
1k
views
Angular internationalization serve in development mode
I would like to get experience with the angular i18n (https://angular.io/guide/i18n#build-from-the-command-line).
I can serve my application with one locale, it's okay. But I can't debug the ...
0
votes
1
answer
243
views
Angular 7 i18n support translate typescript file
Versions.
"@angular-devkit/build-angular": "0.13.4",
"@angular-devkit/build-ng-packagr": "0.13.4",
"@angular/animations": "7.2.2",
"@...
0
votes
3
answers
2k
views
How to pass i18n data to a component as parameter
I don't have a lot of experience with i18n and I'm stuck with this.
I have component within another component. All I want to do is to pass i18n as one of the parameters. How do I do that?
Here is what ...
1
vote
0
answers
212
views
how to add i18n attribute to custom attribute with object type in angular
I have a component that takes a parameter of type object(errorMessage). One of the property(maximumDate) of that object accepts a static text. I recently started internationalizing the application and ...
8
votes
2
answers
4k
views
How to handle angular 11 extract-i18n overriding existing translations?
So i have a angular 11 application where i just implemented localization with angulars default i18n middleware.
To create an initial file i just ran :
ng extract-i18n myprojectName --format xlf --...