#1507 fix-1456 国际化

Merged
wangjr merged 1 commits from fix-1456 into V20220228 2 years ago
  1. +3
    -0
      options/locale/locale_en-US.ini
  2. +3
    -0
      options/locale/locale_zh-CN.ini
  3. +13
    -12
      templates/org/select_pro.tmpl

+ 3
- 0
options/locale/locale_en-US.ini View File

@@ -2078,6 +2078,9 @@ custom_select_courses = Customize selected courses
recommend_remain_pro = Remain
save_fail_tips = The upper limit is exceeded
select_again = Select more than 9, please select again!
custom_select_projects = Customize selected projects
customize = Customize
selected_project=Selected Projects

form.name_reserved = The organization name '%s' is reserved.
form.name_pattern_not_allowed = The pattern '%s' is not allowed in an organization name.


+ 3
- 0
options/locale/locale_zh-CN.ini View File

@@ -2088,6 +2088,9 @@ custom_select_courses = 自定义精选课程
recommend_remain_pro = 还能推荐
save_fail_tips = 最多可选9个,保存失败
select_again = 选择超过9个,请重新选择!
custom_select_projects = 自定义精选项目
customize = 自定义
selected_project=精选项目

form.name_reserved=组织名称 '%s' 是被保留的。
form.name_pattern_not_allowed=组织名称中不允许使用 "%s"。


+ 13
- 12
templates/org/select_pro.tmpl View File

@@ -70,11 +70,11 @@
<div style="width: 100%;margin:15px 0;">
{{if .tags}}
<span class="header">
精选项目
{{.i18n.Tr "org.selected_project"}}
</span>
<!-- {{.IsOrganizationOwner}} -->
{{if .IsOrganizationOwner}}
<a class="text-right" id="model" onclick="showcreate()" >{{svg "octicon-gear" 16}}自定义</a>
<a class="text-right" id="model" onclick="showcreate()" >{{svg "octicon-gear" 16}}{{.i18n.Tr "org.customize"}}</a>
{{end}}
{{end}}
@@ -137,10 +137,10 @@

<div class="ui modal">
<div class="header" style="padding: 1rem;background-color: rgba(240, 240, 240, 100);">
<h4 id="model_header">自定义精选项目</h4>
<h4 id="model_header">{{.i18n.Tr "org.custom_select_projects"}}</h4>
</div>
<div class="content content-padding" style="color: black;">
<p>最多可选9个公开项目</p>
<p>{{.i18n.Tr "org.max_selectedPro"}}</p>
<div class="ui search" >
<div class="ui input" style="width: 100%;">
<input type="text" id = 'search_selectPro' placeholder="Search ..." value = '' oninput="search()">
@@ -223,12 +223,12 @@
function saveSeletedPro(typeTag){
var saveData=[];
$('input[name="select_pro_name"]:checked').each(function(){
console.log('值',this.dataset.repoid)
// console.log('值',this.dataset.repoid)

saveData.push(parseInt(this.dataset.repoid));
})
if(saveData.length>9){
alert("最多可选9个,保存失败")
alert("{{.i18n.Tr "org.save_fail_tips"}}")
return
}
// saveData = getSelecteDataID();
@@ -242,7 +242,7 @@
data:JSON.stringify({'repoList':saveData
}),
success:function(res){
console.log('保存成功');
// console.log('保存成功');
location.reload()

}
@@ -270,15 +270,15 @@
filterData.push(data[i])
}
}
console.log("选中的值:",selectedData)
console.log("筛选包括选中的值:",filterData)
// console.log("选中的值:",selectedData)
// console.log("筛选包括选中的值:",filterData)
var showData=[];
for(i=0;i<selectedData.length;i++){
filterData =filterData.filter((item)=>{
return item.RepoID!=selectedData[i].RepoID
});
}
console.log("筛选后不包括选中的值:",filterData)
// console.log("筛选后不包括选中的值:",filterData)
$("#org_list").empty()
if(searchValue!=""){
if (filterData.length!=0){
@@ -307,7 +307,7 @@
num++
if(num>9){
document.getElementById(id).checked=false
alert("选择超过9个,请重新选择!")
alert("{{.i18n.Tr "org.select_again"}}")
return
}
}
@@ -315,7 +315,8 @@
}

var show_num = 9-num;
document.getElementById("recommend").innerHTML="还能推荐"+show_num+"个"
let rec = "{{.i18n.Tr "org.recommend_remain_pro"}}"
document.getElementById("recommend").innerHTML=rec +" : "+ show_num

}


Loading…
Cancel
Save