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

Commit

Permalink
fix(loader): under circum understances translation table got lost
Browse files Browse the repository at this point in the history
This fix a case in which a translation result would be lost after processing it.

Relates #848
  • Loading branch information
knalli committed Dec 7, 2014
1 parent 5b018cc commit df37381
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/service/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',
if ($nextLang === key) {
$nextLang = undefined;
}
return translation;
}, function (key) {
if ($nextLang === key) {
$nextLang = undefined;
Expand Down Expand Up @@ -1744,6 +1745,7 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',
var processAsyncResult = function (translation) {
translations(translation.key, translation.table);
$rootScope.$emit('$translateChangeEnd', { language: translation.key });
return translation;
};
for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {
langPromises[$fallbackLanguage[i]] = loadAsync($fallbackLanguage[i]).then(processAsyncResult);
Expand Down

0 comments on commit df37381

Please sign in to comment.