angular 10 translation strings IDs dont match

342 Views Asked by At

We have Angular 10.1.4 and use this command to extract strings: ng xi18n --ivy --format=xlf --output-path apps/my-app/src/i18n. Then i convert xlf to json format and during app init i load json translations with loadTranslations(jsonTranslations). Seems straight forward. In my code/templates I dont use custom IDs and let angular generate id.

Problem when i run my app I get this warning in console:

localize.js:392 No translation found for "8594131441489834924" ("Name can not contain numbers and special characters").

I see that particular string in my xlf (and in json file) file but it has different ID from what console shows. Any idea why runtime ID for the same string different from one generated by xi18n?

Much appreciate help.

1

There are 1 best solutions below

0
On

For those who will face similar issue. Problem was that we run our server locally using --aot=false param. Since we run our xi18n with --ivy param it builds it for aot.