Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ angular.module('ngLocalize')
}

function applySubstitutions(text, subs) {
var res = text,
var res = (text instanceof Array ? text.join('') : text),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use angular.isArray instead

firstOfKind = 0;

if (subs) {
Expand Down
10 changes: 9 additions & 1 deletion tests/unit/filterSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ describe('filter', function () {
versionAlt: 'v%major.%minor.%patch',
fullNameAlt: 'My name is {1} {2}',
'key with whitespace': 'valuewithoutwhitespace',
'fullNameDups': 'My full name is {firstName} {lastName} so my "good name" is {firstName}.'
'fullNameDups': 'My full name is {firstName} {lastName} so my "good name" is {firstName}.',
'multiline' : ['line1',
'line2',
'line3']
});
});
});
Expand Down Expand Up @@ -78,5 +81,10 @@ describe('filter', function () {
lastName: 'Smith'
})).toEqual('My full name is John Smith so my "good name" is John.');
}));

it('should combine multiple lines in one line',inject(function(i18nFilter){
expect(i18nFilter('common.multiline'))
.toEqual("line1line2line3");
}));
});
});