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

Commit

Permalink
fix(service): load fallback languages also for instant and filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tspaeth authored and 0x-r4bbit committed Aug 3, 2014
1 parent 53a8bad commit ed6023a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/service/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',
$preferredLanguage = langKey;
}
return $preferredLanguage;
}
};
/**
* @ngdoc function
* @name pascalprecht.translate.$translateProvider#translationNotFoundIndicator
Expand Down Expand Up @@ -1624,9 +1624,11 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',
// Also, if there are any fallback language registered, we start
// loading them asynchronously as soon as we can.
if ($fallbackLanguage && $fallbackLanguage.length) {

var processAsyncResult = function (translation) {
translations(translation.key, translation.table);
};
for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {
langPromises[$fallbackLanguage[i]] = loadAsync($fallbackLanguage[i]);
langPromises[$fallbackLanguage[i]] = loadAsync($fallbackLanguage[i]).then(processAsyncResult);
}
}
}
Expand Down

0 comments on commit ed6023a

Please sign in to comment.