Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate translations for message '9182224963637946835' when merging after update to Angular 13.1 #22398

Closed
hheexx opened this issue Dec 16, 2021 · 16 comments · Fixed by #22524

Comments

@hheexx
Copy link

hheexx commented Dec 16, 2021

Which @angular/* package(s) are the source of the bug?

localize

Is this a regression?

Yes

Description

After updating to Angular 13.1 i have ton of warnings in console that look like this:

WARNING [locales/messages.sr.xlf]: Duplicate translations for message '9088279543992873374' when merging

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular 13.1.1
Node 16.13.1
npm 8.1.2

Anything else?

No response

@alan-agius4 alan-agius4 transferred this issue from angular/angular Dec 16, 2021
@alan-agius4
Copy link
Collaborator

This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

@alan-agius4 alan-agius4 added the needs: repro steps We cannot reproduce the issue with the information given label Dec 16, 2021
@hheexx
Copy link
Author

hheexx commented Dec 16, 2021

Ill try that in few weeks if it's not fixed by then.
Let's wait for now to see if I'm only one with this or there are more people....

Our usage of localization is pretty basic so I assume there will be more people.

@alan-agius4
Copy link
Collaborator

Does this happen during serve or build?

@hheexx
Copy link
Author

hheexx commented Dec 16, 2021

Only serve.
I think I receive warning for every treanslation there is in a file.

@JoniJnm
Copy link

JoniJnm commented Dec 17, 2021

I have the same problem after upgrading to v13

The warnings appears after the first rebuild (I mean, the first "build" while serving is ok, but if I modify a file I see this warnings)

I will try to create a new project to reproduce the problem

@hheexx
Copy link
Author

hheexx commented Dec 17, 2021

I confirm same behavior.
@JoniJnm, have in mind that problem is just in 13.1. 13.0 is ok.

@JoniJnm
Copy link

JoniJnm commented Dec 17, 2021

The repository: https://github.com/JoniJnm/bug-22398

Use "npm start", modify a file and see the i18n warnings

@destus90
Copy link
Contributor

We are facing the same issue after upgrading to the newest version. Glad to see we are not the only ones.

@bbarry
Copy link
Contributor

bbarry commented Dec 21, 2021

I believe it was caused by #16341

More specifically the reload here: 9300545#diff-50f53ef4e38233adf87a2a3af8e79f59cb5befbeb7d053d52a84b76e04d52b18R367-R378 doesn't re-initialize localeDescription.translation between reloads so every reload, every translation is seen as a duplicate.

If only one translation file is permitted during ng serve then it should be easy to fix this with simply adding localeDescription.translation = {}; before reloading. But if translations can cascade across multiple locales (not sure offhand if something like this is supported by Angular) then it is much more complex.

@hheexx
Copy link
Author

hheexx commented Dec 27, 2021

@alan-agius4 we have repo. Update label please.

@dydek
Copy link

dydek commented Jan 6, 2022

we've got the same issue after upgrading to 13.1

@rlejeune
Copy link

rlejeune commented Jan 7, 2022

Same problem here also, started after upgrading to 13.1

@msalzig
Copy link

msalzig commented Jan 8, 2022

Same issue after upgrading to 13.1

bbarry added a commit to bbarry/angular-cli that referenced this issue Jan 10, 2022
Currently when making a change while serving a localized application, duplicate
translation warnings appear for every translation id. This fixes that by
replacing the whole translation object with a new one each time translations
are loaded.

fixes angular#22398
alan-agius4 added a commit to bbarry/angular-cli that referenced this issue Jan 11, 2022
Currently when making a change while serving a localized application, duplicate
translation warnings appear for every translation id. This fixes that by replacing the whole translation object with a new one each time translations are loaded.

fixes angular#22398
alan-agius4 pushed a commit to bbarry/angular-cli that referenced this issue Jan 11, 2022
Currently when making a change while serving a localized application, duplicate
translation warnings appear for every translation id. This fixes that by
replacing the whole translation object with a new one each time translations
are loaded.

fixes angular#22398
alan-agius4 pushed a commit to bbarry/angular-cli that referenced this issue Jan 11, 2022
Currently when making a change while serving a localized application, duplicate
translation warnings appear for every translation id. This fixes that by
replacing the whole translation object with a new one each time translations
are loaded.

fixes angular#22398
alan-agius4 pushed a commit to bbarry/angular-cli that referenced this issue Jan 11, 2022
Currently when making a change while serving a localized application, duplicate
translation warnings appear for every translation id. This fixes that by
replacing the whole translation object with a new one each time translations
are loaded.

fixes angular#22398
@alan-agius4 alan-agius4 added area: @angular-devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix and removed needs: repro steps We cannot reproduce the issue with the information given labels Jan 11, 2022
@ngbot ngbot bot modified the milestone: Backlog Jan 11, 2022
@dawda92
Copy link

dawda92 commented Jan 12, 2022

We've got the same issue within our project running Angular 13.1

@hheexx
Copy link
Author

hheexx commented Jan 12, 2022

@alan-agius4 You added freq1: low tag. It's not low. It's bug in production version of Angular that affects everybody who use localization. That's not low number of people.

dgp1130 pushed a commit that referenced this issue Jan 12, 2022
Currently when making a change while serving a localized application, duplicate
translation warnings appear for every translation id. This fixes that by
replacing the whole translation object with a new one each time translations
are loaded.

fixes #22398
alan-agius4 pushed a commit that referenced this issue Jan 19, 2022
Currently when making a change while serving a localized application, duplicate
translation warnings appear for every translation id. This fixes that by
replacing the whole translation object with a new one each time translations
are loaded.

fixes #22398
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants