Skip to content

Commit 39e2da1

Browse files
authored
fix: angular-translate i8n模版编译错误 (#337)
1 parent b3752b7 commit 39e2da1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

app/main/files/_/file-toolbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
<i
276276
class="fa fa-question-circle"
277277
style="margin-left: 3px;"
278-
uib-tooltip="{{ 'search.files.num_msg' | translate(objects.length) }}"
278+
uib-tooltip="{{ objectLengthI18nTip }}"
279279
tooltip-placement="bottom"
280280
tooltip-append-to-body="true"
281281
></i>

app/main/files/files.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ angular
4747
objectName: "",
4848
},
4949
searchObjectName: searchObjectName,
50-
50+
objects: [],
51+
5152
goIn: goIn,
5253

5354
transVisible: localStorage.getItem("transVisible") == "true",
@@ -124,6 +125,8 @@ angular
124125
uploadsChange: uploadsChange,
125126
downloadsChange: downloadsChange,
126127
},
128+
129+
objectLengthI18nTip: "",
127130
});
128131

129132
if ($scope.isMac) {
@@ -618,6 +621,15 @@ angular
618621
);
619622
}
620623

624+
$scope.$watch(
625+
() => $scope.objects.length,
626+
() => {
627+
$scope.objectLengthI18nTip = T("search.files.num_msg", {
628+
num: $scope.objects.length,
629+
});
630+
}
631+
);
632+
621633
function loadNext() {
622634
if ($scope.nextObjectsMarker) {
623635
console.log("loadNext");

0 commit comments

Comments
 (0)