This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(service): update storage before triggering $translateChangeSuccess
Triggering $translateChangeSuccess before updating the stored language key causes fallback translation to fail the first time $translate.use() is called. The second time it is called with the same language code, it works. This is because promiseToWaitFor() reads what it thinks is the current language from storage, and then proceeds to ignore that as a fallback language. This is not correct behaviour unless the stored language has been updated first. This bug occurs if you have languages AA and BB with storage enabled, and AA set up to as the fallback language. Changing to BB from AA causes AA to be ignored in the fallback chain, and all translations fail.
- Loading branch information