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

Commit

Permalink
fix(fallbackLanguage): fixes bug that fallbackLanguage is loaded with…
Browse files Browse the repository at this point in the history
…out loader
  • Loading branch information
0x-r4bbit committed Aug 7, 2013
1 parent 93d8821 commit 6aa3747
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,12 +844,14 @@ angular.module('pascalprecht.translate').provider('$translate', ['$STORAGE_KEY',

// If at least one async loader is defined and there are no (default) translations available
// we should try to load them.
if ($loaderFactory && angular.equals($translationTable, {})) {
$translate.uses($translate.uses());
}
if ($loaderFactory) {
if (angular.equals($translationTable, {})) {
$translate.uses($translate.uses());
}

if ($fallbackLanguage && !$translationTable[$fallbackLanguage]) {
loadAsync($fallbackLanguage);
if ($fallbackLanguage && !$translationTable[$fallbackLanguage]) {
loadAsync($fallbackLanguage);
}
}

return $translate;
Expand Down

0 comments on commit 6aa3747

Please sign in to comment.