Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

When using partial translations and multiple translate.refresh() are called not all translations are loaded #1326

Closed
cleavera opened this issue Dec 9, 2015 · 8 comments
Labels
Milestone

Comments

@cleavera
Copy link

cleavera commented Dec 9, 2015

When I call $translatePartialLoader.addPart('...') and translate.refresh() in a short space of time the full list of translations is not always loaded in, this leads to the end user being shown missing translations.

The issue seems to happen when you add a part then refresh translations then add another part and refresh it before the previous refresh has completed. If the second refresh is completed then the first is completed then the results of the second refresh are ignored as the first one (with less data) overwrites the data from the second (which has the extra data).

Hopefully this example makes it clearer.
http://codepen.io/antisback/pen/xZGKQK?editors=101
You can toggle the translation working by commenting out the timeout near the end to simulate the first refresh resolving after the second.

@tspaeth
Copy link
Member

tspaeth commented Dec 9, 2015

Is it a duplicate of #1307 ?

@cleavera
Copy link
Author

No this is more about when the requests are returned out of order and some translations are lost.

eg. P = Promise, T=Partial translation
Request: P1(T1), P2(T1, T2), P3(T1, T2, T3)
Response: P1(T1), P3(T1, T2, T3), P2(T1, T2)
Available translations: T1, T2
Then if you manually then perform another translation refresh:
Available translations: T1, T2, T3

cleavera pushed a commit to cleavera/angular-translate that referenced this issue Dec 14, 2015
Ensures that the partial loader service refetches the list of parts when its promise resolves in case the list of parts have changed in the intervening time

Fixes angular-translate#1326
knalli pushed a commit that referenced this issue Dec 27, 2015
Ensures that the partial loader service refetches the list of parts when its promise resolves in case the list of parts have changed in the intervening time

Fixes #1326
@knalli knalli added this to the 2.9.0 milestone Dec 27, 2015
@knalli
Copy link
Member

knalli commented Dec 27, 2015

@cleavera Just picked your PR. Thank you !

@knalli knalli closed this as completed Dec 27, 2015
@knalli knalli added the bug label Dec 27, 2015
@cspeer
Copy link

cspeer commented Feb 14, 2016

Hi there,

is there a release date for 2.9.2? I would really like to see this fix released soon 👍

Thanks,
Chris

@knalli
Copy link
Member

knalli commented Feb 14, 2016

Uhm.. (confused) this is part of 2.9.0 already?

@cspeer
Copy link

cspeer commented Feb 14, 2016

Well,... never mind. I don't know why I thought this would be added in 2.9.2

Thanks!

@amit1911
Copy link

hi, is this issue fixed? I am still facing this issue in 2.15. I am on angular 1.26 btw but using v2.15 for angular-translate. Should i be using a different version of angular translate for angular v 1.26?

@knalli
Copy link
Member

knalli commented Jul 26, 2017

Looks so. Please file a new issue if the bug is still unresolved. And attach an appropriate demo, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants