diff --git a/web/public/locales/en/views/search.json b/web/public/locales/en/views/search.json index fbb43253e..ae363fdba 100644 --- a/web/public/locales/en/views/search.json +++ b/web/public/locales/en/views/search.json @@ -10,6 +10,27 @@ "filterActive": "Filters active" }, "filter": { + "label": { + "cameras": "Cameras", + "labels": "Labels", + "zones": "Zones", + "sub_labels": "Sub Labels", + "search_type": "Search Type", + "time_range": "Time Range", + "before": "Before", + "after": "After", + "min_score": "Min Score", + "max_score": "Max Score", + "min_speed": "Min Speed", + "max_speed": "Max Speed", + "recognized_license_plate": "Recognized License Plate", + "has_clip": "Has Clip", + "has_snapshot": "Has Snapshot" + }, + "searchType": { + "thumbnail": "Thumbnail", + "description": "Description" + }, "toast": { "error": { "beforeDateBeLaterAfter": "The 'before' date must be later than the 'after' date.", @@ -25,11 +46,19 @@ "desc": "Filters help you narrow down your search results. Here's how to use them in the input field:", "desc.step": "
cameras:front_door label:person before:01012024 time_range:3:00PM-4:00PM "
+ },
+ "header": {
+ "currentFilterType": "Filter Values",
+ "noFilters": "Filters",
+ "activeFilters": "Active Filters"
}
},
"similaritySearch": {
"title": "Similarity Search",
"active": "Similarity search active",
"clear": "Clear similarity search"
+ },
+ "placeholder": {
+ "search": "Search..."
}
}
\ No newline at end of file
diff --git a/web/public/locales/zh-CN/views/search.json b/web/public/locales/zh-CN/views/search.json
index 11e806844..76a7a942b 100644
--- a/web/public/locales/zh-CN/views/search.json
+++ b/web/public/locales/zh-CN/views/search.json
@@ -10,6 +10,27 @@
"filterActive": "筛选器已激活"
},
"filter": {
+ "label": {
+ "cameras": "摄像机",
+ "labels": "标签",
+ "zones": "区域",
+ "sub_labels": "子标签",
+ "search_type": "搜索类型",
+ "time_range": "时间范围",
+ "before": "之前",
+ "after": "之后",
+ "min_score": "最低分数",
+ "max_score": "最高分数",
+ "min_speed": "最低速度",
+ "max_speed": "最高速度",
+ "recognized_license_plate": "识别的车牌",
+ "has_clip": "包含片段",
+ "has_snapshot": "包含快照"
+ },
+ "searchType": {
+ "thumbnail": "缩略图",
+ "description": "描述"
+ },
"toast": {
"error": {
"beforeDateBeLaterAfter": "“之前”日期必须晚于“之后”日期。",
@@ -25,11 +46,19 @@
"desc": "筛选器可帮助您缩小搜索范围。注意,目前还暂不支持中文搜索。以下是在输入字段中使用筛选器的方法:",
"desc.step": "cameras:front_door label:person before:01012024 time_range:3:00PM-4:00PM"
+ },
+ "header": {
+ "currentFilterType": "筛选值",
+ "noFilters": "筛选条件",
+ "activeFilters": "激活的筛选项"
}
},
"similaritySearch": {
"title": "相似搜索",
"active": "相似搜索已激活",
"clear": "清除相似搜索"
+ },
+ "placeholder": {
+ "search": "搜索..."
}
}
diff --git a/web/src/components/input/InputWithTags.tsx b/web/src/components/input/InputWithTags.tsx
index 56fc6feb3..ce30a5d89 100644
--- a/web/src/components/input/InputWithTags.tsx
+++ b/web/src/components/input/InputWithTags.tsx
@@ -415,9 +415,15 @@ export default function InputWithTags({
filterType === "has_snapshot" ||
filterType === "is_submitted"
) {
- return filterValues ? "Yes" : "No";
+ return filterValues
+ ? t("button.yes", { ns: "common" })
+ : t("button.no", { ns: "common" });
+ } else if (filterType === "labels") {
+ return t(filterValues as string, { ns: "objects" });
+ } else if (filterType === "search_type") {
+ return t("filter.searchType." + (filterValues as string));
} else {
- return filterValues as string;
+ return (filterValues as string).replaceAll("_", " ");
}
}
@@ -653,7 +659,7 @@ export default function InputWithTags({
onBlur={handleInputBlur}
onKeyDown={handleInputKeyDown}
className="text-md h-9 pr-32"
- placeholder="Search..."
+ placeholder={t("placeholder.search")}
/>