Skip to content

Commit

Permalink
Merge pull request #24 from nogajun/i18n
Browse files Browse the repository at this point in the history
Separated embedded text to YAML file and Translated it.
  • Loading branch information
monniya authored Aug 27, 2017
2 parents ee4ddec + e4b432d commit 2404ba8
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 24 deletions.
10 changes: 9 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ baidu_tongji: 9cdad07c755fa23f6aced510c6760e87
favicon: /images/avatar-small.png

#mathjax
mathjax: true
mathjax: true

# 'Read more' button
excerpt_link: 继续阅读

# Footer message
site_license: <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.</a>
thanks_message: thanks to <a href="https://pages.github.com/">GitHub Pages</a> for free hosting.

14 changes: 14 additions & 0 deletions languages/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
newerpost: "Newer Post"
olderpost: "Older Post"
read: Read
next: Next
previous: Prev
myweibo: Weibo
mygithub: GitHub
mystackoverflow: "Stack Overflow"
mygoogleplus: Google+
myfacebook: Facebook
mytwitter: Twitter
myemail: Mail
blog: Blog
visitblog: "Visit the blog"
14 changes: 14 additions & 0 deletions languages/ja.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
newerpost: "新しい記事"
olderpost: "以前の記事"
read: No.
next: 次へ
previous: 前へ
myweibo: Weibo
mygithub: GitHub
mystackoverflow: "Stack Overflow"
mygoogleplus: Google+
myfacebook: Facebook
mytwitter: Twitter
myemail: Mail
blog: Blog
visitblog: "Blogを読む"
14 changes: 14 additions & 0 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
newerpost: 最近的文章
olderpost: 更早的文章
read: 阅读
next: 更早
previous: 最近
myweibo: 我的微博
mygithub: 查看我的GitHub主页
mystackoverflow: "Stack Overflow"
mygoogleplus: Google+
myfacebook: 上Facebook找我
mytwitter: 上Twitter找我
myemail: 邮件联系我
blog: 博客
visitblog: 访问博客
7 changes: 3 additions & 4 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<footer class="footer">
<span class="footer__copyright">
本站点采用 <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/">知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议</a>
&copy; <%- date(Date.now(), 'YYYY') %> <%= config.author || config.title %><% if (theme.site_license) { %> - This site is licensed under a <%- theme.site_license %><% } %>
</span>
<span class="footer__copyright">
基于 <a href="http://hexo.io">Hexo</a> 搭建,感谢 <a href="https://pages.github.com/">GitHub Pages</a> 提供免费的托管服务
Powered by <a href="http://hexo.io">Hexo</a>. <% if (theme.thanks_message) { %><%- theme.thanks_message %><% } %>
</span>
<span class="footer__copyright">
&copy; <%- date(Date.now(), 'YYYY') %> - 本站使用 <a href="https://github.com/monniya/hexo-theme-new-vno ">new-vno</a> 主题,
由<a href="https://monniya.com ">@Monniya</a> 修改自 <a href="https://github.com/lenbo-ma/hexo-theme-vno" target="_blank">Vno</a>, 原创出自<a href="http://github.com/onevcat/vno" target="_blank">onevcat</a>
This site uses <a href="https://github.com/monniya/hexo-theme-new-vno ">new-vno</a> theme, modified by <a href="https://monniya.com ">@Monniya</a> from <a href="https://github.com/lenbo-ma/hexo-theme-vno" target="_blank">Vno</a>, Original theme from <a href="http://github.com/onevcat/vno" target="_blank">onevcat</a>
</span>
<% if (page.mathjax){ %>
<%- partial('_partial/mathjax') %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/head.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html <% if (config.language) { %>lang="<%= config.language[0] %>"<% } %>>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
Expand Down
8 changes: 4 additions & 4 deletions layout/_partial/read-more.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% if (page.prev){ %>
<div class="read-more-item">
<span class="read-more-item-dim">最近的文章</span>
<span class="read-more-item-dim"><%= __('newerpost') %></span>
<h2 class="post-list__post-title post-title"><a href="<%- config.root %><%- page.prev.path %>" title="<%= page.prev.title %>"><%= page.prev.title %></a></h2>
<p class="excerpt">
<% if (page.prev.excerpt){ %>
Expand All @@ -12,14 +12,14 @@
<%= strip_html(page.prev.content).substring(0, 150)%>
<% } %>&hellip;
</p>
<div class="post-list__meta"><%- partial('_partial/date',{post: page.prev}) %> &#8226; <span class="post-list__meta--tags tags">&nbsp;<%- partial('_partial/tags',{post: page.prev}) %></span><a class="btn-border-small" href="<%- config.root %><%- page.prev.path %>">继续阅读</a></div>
<div class="post-list__meta"><%- partial('_partial/date',{post: page.prev}) %> &#8226; <span class="post-list__meta--tags tags"> <%- partial('_partial/tags',{post: page.prev}) %></span><a class="btn-border-small" href="<%- config.root %><%- page.prev.path %>"><%= theme.excerpt_link %></a></div>
</div>
<% } %>
<% if (page.next){ %>
<div class="read-more-item">
<span class="read-more-item-dim">更早的文章</span>
<span class="read-more-item-dim"><%= __('olderpost') %></span>
<h2 class="post-list__post-title post-title"><a href="<%- config.root %><%- page.next.path %>" title="<%= page.next.title %>"><%= page.next.title %></a></h2>
<p class="excerpt">
<% if (page.next.excerpt){ %>
Expand All @@ -28,7 +28,7 @@
<%= strip_html(page.next.content).substring(0, 150)%>
<% } %>&hellip;
</p>
<div class="post-list__meta"><%- partial('_partial/date',{post: page.next}) %> &#8226; <span class="post-list__meta--tags tags">&nbsp;<%- partial('_partial/tags',{post: page.next}) %></span><a class="btn-border-small" href="<%- config.root %><%- page.next.path %>">继续阅读</a></div>
<div class="post-list__meta"><%- partial('_partial/date',{post: page.next}) %> &#8226; <span class="post-list__meta--tags tags"> <%- partial('_partial/tags',{post: page.next}) %></span><a class="btn-border-small" href="<%- config.root %><%- page.next.path %>"><%= theme.excerpt_link %></a></div>
</div>
<% } %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/side-panel.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div>
<nav class="cover-navigation cover-navigation--primary">
<ul class="navigation">
<li class="navigation__item"><a href="/#blog" title="访问博客" class="blog-button">博客</a></li>
<li class="navigation__item"><a href="/#blog" title="<%= __('visitblog') %>" class="blog-button"><%= __('blog') %></a></li>
<% for (var i in theme.menu){ %>
<li class="navigation__item"><a href="<%- theme.menu[i] %>"><%= i %></a></li>
<% } %>
Expand Down
14 changes: 7 additions & 7 deletions layout/_partial/social.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Weibo-->
<% if (theme.social.weibo) { %>
<li class="navigation__item">
<a href="<%= theme.social.weibo%>" title="我的微博" target="_blank">
<a href="<%= theme.social.weibo%>" title="<%= __('myweibo') %>" target="_blank">
<i class='social fa fa-weibo'></i>
<span class="label">Weibo</span>
</a>
Expand All @@ -14,7 +14,7 @@
<!-- Github -->
<% if (theme.social.github) { %>
<li class="navigation__item">
<a href="<%= theme.social.github%>" title="查看我的GitHub主页" target="_blank">
<a href="<%= theme.social.github%>" title="<%= __('mygithub') %>" target="_blank">
<i class='social fa fa-github'></i>
<span class="label">Github</span>
</a>
Expand All @@ -24,7 +24,7 @@
<!-- Stack Overflow -->
<% if (theme.social.stack_overflow) { %>
<li class="navigation__item">
<a href="<%= theme.social.stack_overflow %>" title="Stack Overflow" target="_blank">
<a href="<%= theme.social.stack_overflow %>" title="<%= __('mystackoverflow') %>" target="_blank">
<i class='social fa fa-stack-overflow'></i>
<span class="label">Stack Overflow</span>
</a>
Expand All @@ -34,7 +34,7 @@
<!-- Google Plus -->
<% if (theme.social["google_plus"]) { %>
<li class="navigation__item">
<a href="<%= theme.social['google_plus'] %>" title="Google+" target="_blank">
<a href="<%= theme.social['google_plus'] %>" title="<%= __('mygoogleplus') %>" target="_blank">
<i class='social fa fa-google-plus-square'></i>
<span class="label">Google+</span>
</a>
Expand All @@ -44,7 +44,7 @@
<!-- Facebook -->
<% if (theme.social.facebook) { %>
<li class="navigation__item">
<a href="<%= theme.social.facebook%>" title="上Facebook找我" target="_blank">
<a href="<%= theme.social.facebook%>" title="<%= __('myfacebook') %>" target="_blank">
<i class='social fa fa-facebook'></i>
<span class="label">Facebook</span>
</a>
Expand All @@ -54,7 +54,7 @@
<!-- Twitter -->
<% if (theme.social.twitter) { %>
<li class="navigation__item">
<a href="<%= theme.social.twitter%>" title="上Twitter找我" target="_blank">
<a href="<%= theme.social.twitter%>" title="<%= __('mytwitter') %>" target="_blank">
<i class='social fa fa-twitter'></i>
<span class="label">Twitter</span>
</a>
Expand All @@ -71,7 +71,7 @@
<% } %>
<% if (config.email) { %>
<li class="navigation__item">
<a href="mailto:<%= config.email%>" title="邮件联系我" target="_blank">
<a href="mailto:<%= config.email%>" title="<%= __('myemail') %>" target="_blank">
<i class='social fa fa-envelope'></i>
<span class="label">Email</span>
</a>
Expand Down
8 changes: 4 additions & 4 deletions layout/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<%= strip_html(post.content).substring(0, 200)%>
<% } %>&hellip;
</p>
<div class="post-list__meta"><%- partial('_partial/date',{post: post}) %> &#8226; <span class="post-list__meta--tags tags">&nbsp;<%- partial('_partial/tags',{post: post}) %></span><a class="btn-border-small" href="<%- config.root %><%- link%>">继续阅读</a></div>
<div class="post-list__meta"><%- partial('_partial/date',{post: post}) %> &#8226; <span class="post-list__meta--tags tags"> <%- partial('_partial/tags',{post: post}) %></span><a class="btn-border-small" href="<%- config.root %><%- link%>"><%= theme.excerpt_link %></a></div>
<hr class="post-list__divider" />
</li>
<% }) %>
Expand All @@ -28,11 +28,11 @@
page.prev_link = "/#blog";
}
%>
<a class="older-posts pagination__older btn btn-small btn-tertiary" href="<%- url_for(page.prev_link) %>">← 最近</a>
<a class="older-posts pagination__newer btn btn-small btn-tertiary" href="<%- url_for(page.prev_link) %>">&larr; <%= __('previous') %></a>
<% } %>
<span class="pagination__page-number" > <%= page.current %> / <%= page.total %> </span>
<span class="pagination__page-number" > <%= page.current %> / <%= page.total %> </span>
<% if (page.next){ %>
<a class="older-posts pagination__older btn btn-small btn-tertiary" href="<%- url_for(page.next_link) %>">更早 →</a>
<a class="older-posts pagination__older btn btn-small btn-tertiary" href="<%- url_for(page.next_link) %>"><%= __('next') %> &rarr;</a>
<% } %>
</nav>
<% } %>
Expand Down
4 changes: 2 additions & 2 deletions layout/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<header class="post-header">
<div class="post-meta">
<%- partial('_partial/date',{post: page}) %> &#8226; <span class="post-meta__tags tags">于&nbsp;<%- partial('_partial/tags',{post: page}) %> </span>
<%- partial('_partial/date',{post: page}) %> &#8226; <span class="post-meta__tags tags">于 <%- partial('_partial/tags',{post: page}) %> </span>
<span class="page-pv">
&nbsp;阅读&nbsp;<span id="busuanzi_value_page_pv"><i class="fa fa-spinner fa-spin"></i></span>
<%= __('read') %> <span id="busuanzi_value_page_pv"><i class="fa fa-spinner fa-spin"></i></span>
</span>

</div>
Expand Down

1 comment on commit 2404ba8

@nogajun
Copy link
Contributor

@nogajun nogajun commented on 2404ba8 Sep 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 谢谢! ありがとう! 👍

Please sign in to comment.