ソースを参照

Add formatNoMatches locale.

zhixin 11 年 前
コミット
7ae6b5e230

+ 4 - 1
src/bootstrap-table.js

@@ -73,6 +73,9 @@
         formatSearch: function() {
             return 'Search';
         },
+        formatNoMatches: function() {
+            return 'No matching records found';
+        },
 
         onClickRow: function(item) {return false;},
         onSort: function(name, order) {return false;},
@@ -508,7 +511,7 @@
         // show no records
         if (!html.length) {
             html.push('<tr class="no-records-found">',
-                sprintf('<td colspan="%s">No matching records found</td>', this.header.fields.length),
+                sprintf('<td colspan="%s">%s</td>', this.header.fields.length, this.options.formatNoMatches()),
                 '</tr>');
         }
 

+ 3 - 0
src/locale/bootstrap-table-en.js

@@ -14,6 +14,9 @@
         },
         formatSearch: function() {
             return 'Search'
+        },
+        formatNoMatches: function() {
+            return 'No matching records found';
         }
     });
 })(jQuery);

+ 3 - 0
src/locale/bootstrap-table-en.js.template

@@ -14,6 +14,9 @@
         },
         formatSearch: function() {
             return 'Search'
+        },
+        formatNoMatches: function() {
+            return 'No matching records found';
         }
     });
 })(jQuery);

+ 3 - 0
src/locale/bootstrap-table-zh-CN.js

@@ -14,6 +14,9 @@
         },
         formatSearch: function() {
             return '搜索';
+        },
+        formatNoMatches: function() {
+            return '没有找到匹配的记录';
         }
     });
 })(jQuery);