Browse Source

feat: add head i18n

master
colorfulberry 5 years ago
parent
commit
9df2da9468
3 changed files with 43 additions and 19 deletions
  1. +22
    -19
      custom/templates/base/head_navbar.tmpl
  2. +11
    -0
      options/locale/locale_en-US.ini
  3. +10
    -0
      options/locale/locale_zh-CN.ini

+ 22
- 19
custom/templates/base/head_navbar.tmpl View File

@@ -11,18 +11,18 @@
{{if .IsSigned}}
<a class="item {{if .PageIsDashboard}}active{{end}}" href="/">{{.i18n.Tr "dashboard"}}</a>
<div class="ui dropdown item">
社区
{{.i18n.Tr "custom.head.community"}}
<i class="dropdown icon"></i>
<div class="menu">
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0228/17.html">欢迎加入OpenI</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/14.html">组织结构</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/15.html">启智开源许可证</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/16.html">OpenI社区章程</a>
<a class="item" href="https://www.openi.org.cn/html/news/dongtai/">社区动态</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0228/17.html">{{.i18n.Tr "custom.head.welcome"}}</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/14.html">{{.i18n.Tr "custom.head.about_org"}}</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/15.html">{{.i18n.Tr "custom.head.license"}}</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/16.html">{{.i18n.Tr "custom.head.community_charter"}}</a>
<a class="item" href="https://www.openi.org.cn/html/news/dongtai/">{{.i18n.Tr "custom.head.community_infos"}}</a>
</div>
</div>
<a class="item" href="{{AppSubUrl}}/datasets">{{.i18n.Tr "datasets"}}</a>
<a class="item" href="{{AppSubUrl}}/explore/repos">项目</a>
<a class="item" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "custom.head.project"}}</a>
{{if not .UnitIssuesGlobalDisabled}}
<a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a>
{{end}}
@@ -36,31 +36,34 @@
{{.i18n.Tr "explore"}}
<i class="dropdown icon"></i>
<div class="menu">
<a class="item" href="javascript:alert('WIP')">学习</a>
<a class="item" href="javascript:alert('WIP')">活动</a>
<a class="item" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "custom.head.project"}}</a>
<a class="item" href="{{AppSubUrl}}/datasets">{{.i18n.Tr "datasets"}}</a>
<a class="item" href="javascript:alert('WIP')">{{.i18n.Tr "custom.head.study"}}</a>
<a class="item" href="javascript:alert('WIP')">{{.i18n.Tr "custom.head.activity"}}</a>
</div>
</div>
{{else if .IsLandingPageHome}}
<a class="item {{if .PageIsHome}}active{{end}}" href="/">{{.i18n.Tr "home"}}</a>
<div class="ui dropdown item">
社区
{{.i18n.Tr "custom.head.community"}}
<i class="dropdown icon"></i>
<div class="menu">
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0228/17.html">欢迎加入OpenI</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/14.html">组织结构</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/15.html">启智开源许可证</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/16.html">OpenI社区章程</a>
<a class="item" href="https://www.openi.org.cn/html/news/dongtai/">社区动态</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0228/17.html">{{.i18n.Tr "custom.head.welcome"}}</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/14.html">{{.i18n.Tr "custom.head.about_org"}}</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/15.html">{{.i18n.Tr "custom.head.license"}}</a>
<a class="item" href="https://www.openi.org.cn/html/Club/2019/0227/16.html">{{.i18n.Tr "custom.head.community_charter"}}</a>
<a class="item" href="https://www.openi.org.cn/html/news/dongtai/">{{.i18n.Tr "custom.head.community_infos"}}</a>
</div>
</div>
<a class="item" href="{{AppSubUrl}}/explore/repos">项目</a>
<a class="item" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "custom.head.project"}}</a>
<div class="ui dropdown item">
{{.i18n.Tr "explore"}}
<i class="dropdown icon"></i>
<div class="menu">
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">更多开源项目</a>
<a class="item" href="https://openi.org.cn/welcome/shixuns" target="_blank">学习</a>
<a class="item" href="http://club.openi.org.cn/portal.php?mod=list&amp;catid=4" target="_blank">活动</a>
<a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "custom.head.project"}}</a>
<a class="item" href="{{AppSubUrl}}/datasets">{{.i18n.Tr "datasets"}}</a>
<a class="item" href="javascript:alert('WIP')" target="_blank">{{.i18n.Tr "custom.head.project"}}</a>
<a class="item" href="javascript:alert('WIP')" target="_blank">{{.i18n.Tr "custom.head.activity"}}</a>
</div>
</div>
{{else if .IsLandingPageExplore}}


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

@@ -2439,3 +2439,14 @@ error.probable_bad_default_signature = "WARNING! Although the default key has th
[units]
error.no_unit_allowed_repo = You are not allowed to access any section of this repository.
error.unit_not_allowed = You are not allowed to access this repository section.

[custom]
head.community=Community
head.welcome=Welcome to OpenI
head.about_org=About orgnation
head.license=OpenI open source license
head.community_charter=OpenI Community Charter
head.community_infos=Community News
head.project=Project
head.study=Study
head.activity=Activity

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

@@ -2440,3 +2440,13 @@ error.probable_bad_default_signature=警告!虽然默认密钥拥有此ID,
error.no_unit_allowed_repo=您没有被允许访问此仓库的任何单元。
error.unit_not_allowed=您没有权限访问此仓库单元

[custom]
head.community=社区
head.welcome=欢迎加入启智
head.about_org=关于组织架构
head.license=启智开源许可证
head.community_charter=启智社区章程
head.community_infos=社区动态
head.project=项目
head.study=学些
head.activity=活动

Loading…
Cancel
Save