2727 showSearch : '=?' ,
2828 searchFilter : '=?' ,
2929 disabled : '=?ngDisabled' ,
30- defaultText : '@ '
30+ labels : '=? '
3131 } ,
3232 require : 'ngModel' ,
3333 templateUrl : 'multiselect.html' ,
3434 link : function ( $scope , $element , $attrs , $ngModelCtrl ) {
3535 $scope . selectionLimit = $scope . selectionLimit || 0 ;
3636 $scope . searchLimit = $scope . searchLimit || 25 ;
37- $scope . defaultText = $scope . defaultText || 'Select' ;
3837
3938 $scope . searchFilter = '' ;
4039
116115 return $scope . getDisplay ( $scope . selectedOptions [ 0 ] ) ;
117116 }
118117 if ( $scope . selectedOptions && $scope . selectedOptions . length > 1 ) {
119- var totalSelected ;
120- totalSelected = angular . isDefined ( $scope . selectedOptions ) ? $scope . selectedOptions . length : 0 ;
118+ var totalSelected = angular . isDefined ( $scope . selectedOptions ) ? $scope . selectedOptions . length : 0 ;
121119 if ( totalSelected === 0 ) {
122- return $scope . defaultText ;
120+ return $scope . labels && $scope . labels . select ? $scope . labels . select : 'Select' ;
123121 } else {
124- return totalSelected + ' ' + 'selected' ;
122+ return totalSelected + ' ' + ( $scope . labels && $scope . labels . itemsSelected ? $scope . labels . itemsSelected : 'selected' ) ;
125123 }
126124 } else {
127- return $scope . defaultText ;
125+ return $scope . labels && $scope . labels . select ? $scope . labels . select : 'Select' ;
128126 }
129127 } ;
130128
@@ -246,12 +244,12 @@ angular.module("multiselect.html", []).run(["$templateCache", function($template
246244 "\n" +
247245 " <li ng-show=\"showSelectAll\">\n" +
248246 " <a ng-click=\"selectAll()\" href=\"\">\n" +
249- " <span class=\"glyphicon glyphicon-ok\"></span> Select All\n" +
247+ " <span class=\"glyphicon glyphicon-ok\"></span> {{labels.selectAll || ' Select All'}} \n" +
250248 " </a>\n" +
251249 " </li>\n" +
252250 " <li ng-show=\"showUnselectAll\">\n" +
253251 " <a ng-click=\"unselectAll()\" href=\"\">\n" +
254- " <span class=\"glyphicon glyphicon-remove\"></span> Unselect All\n" +
252+ " <span class=\"glyphicon glyphicon-remove\"></span> {{labels.unselectAll || ' Unselect All'}} \n" +
255253 " </a>\n" +
256254 " </li>\n" +
257255 " <li ng-show=\"(showSelectAll || showUnselectAll)\"\n" +
@@ -269,7 +267,7 @@ angular.module("multiselect.html", []).run(["$templateCache", function($template
269267 " <li ng-show=\"showSearch\">\n" +
270268 " <div class=\"dropdown-header\">\n" +
271269 " <input type=\"text\" class=\"form-control input-sm\" style=\"width: 100%;\"\n" +
272- " ng-model=\"searchFilter\" placeholder=\"Search...\" ng-change=\"updateOptions()\"/>\n" +
270+ " ng-model=\"searchFilter\" placeholder=\"{{labels.search || ' Search...'}} \" ng-change=\"updateOptions()\"/>\n" +
273271 " </div>\n" +
274272 " </li>\n" +
275273 "\n" +
@@ -284,7 +282,7 @@ angular.module("multiselect.html", []).run(["$templateCache", function($template
284282 "\n" +
285283 " <li class=\"divider\" ng-show=\"selectionLimit > 1\"></li>\n" +
286284 " <li role=\"presentation\" ng-show=\"selectionLimit > 1\">\n" +
287- " <a>{{selectedOptions.length || 0}} / {{selectionLimit}} selected</a>\n" +
285+ " <a>{{selectedOptions.length || 0}} / {{selectionLimit}} {{labels.itemsSelected || ' selected'}} </a>\n" +
288286 " </li>\n" +
289287 "\n" +
290288 " </ul>\n" +
0 commit comments