Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/localize.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ angular.module('localization', [])
var result = '';

// make sure the dictionary has valid data
if (localize.resourceFileLoaded) {
if ((localize.dictionary !== []) && (localize.dictionary.length > 0)) {
// use the filter service to only return those entries which match the value
// and only take the first result
var entry = $filter('filter')(localize.dictionary, function(element) {
return element.key === value;
}
);
// set the result
result = entry[value] ? entry[value] : value;
result = entry[0] ? entry[0].value : value;
}
// return the value to the call
return result;
Expand Down