Skip to content

Commit ac4b0bd

Browse files
committed
Merge pull request #2068 from cxr29/master
Fix pinning column menu item duplication when i18n, update i18n zh-cn.js and zh-tw.js.
2 parents 5db3e7c + 642a8e4 commit ac4b0bd

File tree

3 files changed

+91
-68
lines changed

3 files changed

+91
-68
lines changed

src/features/pinning/js/pinning.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
}
124124

125125
var pinColumnLeftAction = {
126+
name: 'ui.grid.pinning.pinLeft',
126127
title: i18nService.get().pinning.pinLeft,
127128
icon: 'ui-grid-icon-left-open',
128129
shown: function () {
@@ -143,6 +144,7 @@
143144
};
144145

145146
var pinColumnRightAction = {
147+
name: 'ui.grid.pinning.pinRight',
146148
title: i18nService.get().pinning.pinRight,
147149
icon: 'ui-grid-icon-right-open',
148150
shown: function () {
@@ -164,6 +166,7 @@
164166
};
165167

166168
var removePinAction = {
169+
name: 'ui.grid.pinning.unpin',
167170
title: i18nService.get().pinning.unpin,
168171
icon: 'ui-grid-icon-cancel',
169172
shown: function () {
@@ -181,13 +184,13 @@
181184
}
182185
};
183186

184-
if (!gridUtil.arrayContainsObjectWithProperty(col.menuItems, 'title', 'Pin Left')) {
187+
if (!gridUtil.arrayContainsObjectWithProperty(col.menuItems, 'name', 'ui.grid.pinning.pinLeft')) {
185188
col.menuItems.push(pinColumnLeftAction);
186189
}
187-
if (!gridUtil.arrayContainsObjectWithProperty(col.menuItems, 'title', 'Pin Right')) {
190+
if (!gridUtil.arrayContainsObjectWithProperty(col.menuItems, 'name', 'ui.grid.pinning.pinRight')) {
188191
col.menuItems.push(pinColumnRightAction);
189192
}
190-
if (!gridUtil.arrayContainsObjectWithProperty(col.menuItems, 'title', 'Unpin')) {
193+
if (!gridUtil.arrayContainsObjectWithProperty(col.menuItems, 'name', 'ui.grid.pinning.unpin')) {
191194
col.menuItems.push(removePinAction);
192195
}
193196
}
@@ -214,4 +217,4 @@
214217
}]);
215218

216219

217-
})();
220+
})();

src/js/i18n/zh-cn.js

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,66 @@
1-
(function () {
1+
(function() {
22
angular.module('ui.grid').config(['$provide', function($provide) {
33
$provide.decorator('i18nService', ['$delegate', function($delegate) {
44
$delegate.add('zh-cn', {
55
aggregate: {
6-
label: '条目'
6+
label: ''
77
},
88
groupPanel: {
9-
description: '拖曳表头到此处以进行分组'
9+
description: '拖曳表头到此处进行分组'
1010
},
1111
search: {
12-
placeholder: '搜索...',
13-
showingItems: '当前显示条目:',
14-
selectedItems: '选中条目:',
15-
totalItems: '条目总数:',
16-
size: '每页显示数:',
17-
first: '回到首页',
12+
placeholder: '查找',
13+
showingItems: '已显示行数:',
14+
selectedItems: '已选择行数:',
15+
totalItems: '总行数:',
16+
size: '每页显示行数:',
17+
first: '首页',
1818
next: '下一页',
1919
previous: '上一页',
20-
last: '前往尾页'
20+
last: '末页'
2121
},
2222
menu: {
23-
text: '数据分组与选择列:'
23+
text: '选择列:'
24+
},
25+
sort: {
26+
ascending: '升序',
27+
descending: '降序',
28+
remove: '取消排序'
2429
},
2530
column: {
2631
hide: '隐藏列'
2732
},
2833
aggregation: {
29-
count: 'total rows: ',
30-
sum: 'total: ',
31-
avg: 'avg: ',
32-
min: 'min: ',
33-
max: 'max: '
34+
count: '计数:',
35+
sum: '求和:',
36+
avg: '均值:',
37+
min: '最小值:',
38+
max: '最大值:'
39+
},
40+
pinning: {
41+
pinLeft: '左侧固定',
42+
pinRight: '右侧固定',
43+
unpin: '取消固定'
3444
},
3545
gridMenu: {
36-
columns: 'Columns:',
37-
importerTitle: 'Import file',
38-
exporterAllAsCsv: 'Export all data as csv',
39-
exporterVisibleAsCsv: 'Export visible data as csv',
40-
exporterSelectedAsCsv: 'Export selected data as csv',
41-
exporterAllAsPdf: 'Export all data as pdf',
42-
exporterVisibleAsPdf: 'Export visible data as pdf',
43-
exporterSelectedAsPdf: 'Export selected data as pdf'
46+
columns: '列:',
47+
importerTitle: '导入文件',
48+
exporterAllAsCsv: '导出全部数据到CSV',
49+
exporterVisibleAsCsv: '导出可见数据到CSV',
50+
exporterSelectedAsCsv: '导出已选数据到CSV',
51+
exporterAllAsPdf: '导出全部数据到PDF',
52+
exporterVisibleAsPdf: '导出可见数据到PDF',
53+
exporterSelectedAsPdf: '导出已选数据到PDF'
4454
},
4555
importer: {
46-
noHeaders: 'Column names were unable to be derived, does the file have a header?',
47-
noObjects: 'Objects were not able to be derived, was there data in the file other than headers?',
48-
invalidCsv: 'File was unable to be processed, is it valid CSV?',
49-
invalidJson: 'File was unable to be processed, is it valid Json?',
50-
jsonNotArray: 'Imported json file must contain an array, aborting.'
56+
noHeaders: '无法获取列名,确定文件包含表头?',
57+
noObjects: '无法获取数据,确定文件包含数据?',
58+
invalidCsv: '无法处理文件,确定是合法的CSV文件?',
59+
invalidJson: '无法处理文件,确定是合法的JSON文件?',
60+
jsonNotArray: '导入的文件不是JSON数组!'
5161
}
5262
});
5363
return $delegate;
5464
}]);
55-
}]);
65+
}]);
5666
})();

src/js/i18n/zh-tw.js

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,66 @@
1-
(function () {
1+
(function() {
22
angular.module('ui.grid').config(['$provide', function($provide) {
33
$provide.decorator('i18nService', ['$delegate', function($delegate) {
44
$delegate.add('zh-tw', {
55
aggregate: {
6-
label: ''
6+
label: ''
77
},
88
groupPanel: {
9-
description: '拖拉表頭到此處以進行分組'
9+
description: '拖曳表頭到此處進行分組'
1010
},
1111
search: {
12-
placeholder: '搜尋...',
13-
showingItems: '目前顯示筆數:',
14-
selectedItems: '選取筆數:',
15-
totalItems: '總筆數:',
16-
size: '每頁顯示:',
17-
first: '第一頁',
18-
next: '下一頁',
19-
previous: '上一頁',
20-
last: '最後頁'
12+
placeholder: '查找',
13+
showingItems: '已顯示行數:',
14+
selectedItems: '已選擇行數:',
15+
totalItems: '總行數:',
16+
size: '每頁顯示行數:',
17+
first: '首頁',
18+
next: '下壹頁',
19+
previous: '上壹頁',
20+
last: '末頁'
2121
},
2222
menu: {
23-
text: '選擇欄位:'
23+
text: '選擇列:'
24+
},
25+
sort: {
26+
ascending: '升序',
27+
descending: '降序',
28+
remove: '取消排序'
2429
},
2530
column: {
26-
hide: '隐藏列'
31+
hide: '隱藏列'
2732
},
2833
aggregation: {
29-
count: 'total rows: ',
30-
sum: 'total: ',
31-
avg: 'avg: ',
32-
min: 'min: ',
33-
max: 'max: '
34+
count: '計數:',
35+
sum: '求和:',
36+
avg: '均值:',
37+
min: '最小值:',
38+
max: '最大值:'
39+
},
40+
pinning: {
41+
pinLeft: '左側固定',
42+
pinRight: '右側固定',
43+
unpin: '取消固定'
3444
},
3545
gridMenu: {
36-
columns: 'Columns:',
37-
importerTitle: 'Import file',
38-
exporterAllAsCsv: 'Export all data as csv',
39-
exporterVisibleAsCsv: 'Export visible data as csv',
40-
exporterSelectedAsCsv: 'Export selected data as csv',
41-
exporterAllAsPdf: 'Export all data as pdf',
42-
exporterVisibleAsPdf: 'Export visible data as pdf',
43-
exporterSelectedAsPdf: 'Export selected data as pdf'
46+
columns: '列:',
47+
importerTitle: '導入文件',
48+
exporterAllAsCsv: '導出全部數據到CSV',
49+
exporterVisibleAsCsv: '導出可見數據到CSV',
50+
exporterSelectedAsCsv: '導出已選數據到CSV',
51+
exporterAllAsPdf: '導出全部數據到PDF',
52+
exporterVisibleAsPdf: '導出可見數據到PDF',
53+
exporterSelectedAsPdf: '導出已選數據到PDF'
4454
},
4555
importer: {
46-
noHeaders: 'Column names were unable to be derived, does the file have a header?',
47-
noObjects: 'Objects were not able to be derived, was there data in the file other than headers?',
48-
invalidCsv: 'File was unable to be processed, is it valid CSV?',
49-
invalidJson: 'File was unable to be processed, is it valid Json?',
50-
jsonNotArray: 'Imported json file must contain an array, aborting.'
56+
noHeaders: '無法獲取列名,確定文件包含表頭?',
57+
noObjects: '無法獲取數據,確定文件包含數據?',
58+
invalidCsv: '無法處理文件,確定是合法的CSV文件?',
59+
invalidJson: '無法處理文件,確定是合法的JSON文件?',
60+
jsonNotArray: '導入的文件不是JSON數組!'
5161
}
5262
});
5363
return $delegate;
5464
}]);
55-
}]);
56-
})();
65+
}]);
66+
})();

0 commit comments

Comments
 (0)