Browse Source

解决国际化问题

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.3.2^2
zouap 4 years ago
parent
commit
5f73ada246
1 changed files with 59 additions and 6 deletions
  1. +59
    -6
      public/home/search.js

+ 59
- 6
public/home/search.js View File

@@ -269,6 +269,13 @@ var categoryDesc={
"computer_vision_natural_language_processing":"计算机视觉、自然语言处理"
};

var categoryENDesc={
"computer_vision":"computer vision",
"natural_language_processing":"natural language processing",
"speech_processing":"speech processing",
"computer_vision_natural_language_processing":"computer vision and natural language processing"
};

var taskDesc={
"machine_translation":"机器翻译",
"question_answering_system":"问答系统",
@@ -305,16 +312,62 @@ var taskDesc={
"speech_synthesis":"语音合成"
};

function getCategoryDesc(key){
var re = categoryDesc[key];
var taskENDesc={
"machine_translation":"machine translation",
"question_answering_system":"question answering system",
"information_retrieval":"information retrieval",
"knowledge_graph":"knowledge graph",
"text_annotation":"text annotation",
"text_categorization":"text categorization",
"emotion_analysis":"emotion analysis",
"language_modeling":"language modeling",
"speech_recognition":"speech recognition",
"automatic_digest":"automatic digest",
"information_extraction":"information extraction",
"description_generation":"description generation",
"image_classification":"image classification",
"face_recognition":"face recognition",
"image_search":"image search",
"target_detection":"target detection",
"image_description_generation":"image description generation",
"vehicle_license_plate_recognition":"vehicle license plate recognition",
"medical_image_analysis":"medical image analysis",
"unmanned":"unmanned",
"unmanned_security":"unmanned security",
"drone":"drone",
"vr_ar":"VR/AR",
"2_d_vision":"2.D vision",
"2.5_d_vision":"2.5D vision",
"3_d_reconstruction":"3Dreconstruction",
"image_processing":"image processing",
"video_processing":"video processing",
"visual_input_system":"visual input system",
"speech_coding":"speech coding",
"speech_enhancement":"speech enhancement",
"speech_recognition":"speech recognition",
"speech_synthesis":"speech synthesis"
};

function getCategoryDesc(isZh,key){
var re = key;
if(isZh){
re = categoryDesc[key];
}else{
re = categoryENDesc[key];
}
if(isEmpty(re)){
return key;
}
return re;
}

function getTaskDesc(key){
var re = taskDesc[key];
function getTaskDesc(isZh,key){
var re = key;
if(isZh){
re = taskDesc[key];
}else{
re = taskENDesc[key];
}
if(isEmpty(re)){
return key;
}
@@ -354,10 +407,10 @@ function displayDataSetResult(page,jsonResult,onlyReturnNum,keyword){
html += " <div class=\"content\">";
html += " <div class=\"ui right metas\">" ;
if(!isEmpty(recordMap["category"])){
html += " <span class=\"text grey\"><svg class=\"svg octicon-tasklist\" width=\"16\" height=\"16\" aria-hidden=\"true\"><use xlink:href=\"#octicon-tasklist\" /></svg> " + getCategoryDesc(recordMap["category"]) + "</span>";
html += " <span class=\"text grey\"><svg class=\"svg octicon-tasklist\" width=\"16\" height=\"16\" aria-hidden=\"true\"><use xlink:href=\"#octicon-tasklist\" /></svg> " + getCategoryDesc(isZh,recordMap["category"]) + "</span>";
}
if(!isEmpty(recordMap["task"])){
html += " <span class=\"text grey\"><svg class=\"svg octicon-tag\" width=\"16\" height=\"16\" aria-hidden=\"true\"><use xlink:href=\"#octicon-tag\" /></svg>" + getTaskDesc(recordMap["task"]) + "</span>";
html += " <span class=\"text grey\"><svg class=\"svg octicon-tag\" width=\"16\" height=\"16\" aria-hidden=\"true\"><use xlink:href=\"#octicon-tag\" /></svg>" + getTaskDesc(isZh,recordMap["task"]) + "</span>";
}
html += " <span class=\"text grey\"><i class=\"ri-fire-line\"></i> " +recordMap["download_times"] + "</span> ";
html +=" </div>";


Loading…
Cancel
Save