From a1403bae59cc48e68b7e880f6c1f0a6b447614aa Mon Sep 17 00:00:00 2001 From: AV <av@example.com> Date: Fri, 8 Jan 2016 17:02:24 +0300 Subject: [PATCH 1/7] Add RU language file --- languages/ru.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 languages/ru.yml diff --git a/languages/ru.yml b/languages/ru.yml new file mode 100644 index 0000000000..065957ae86 --- /dev/null +++ b/languages/ru.yml @@ -0,0 +1,12 @@ +categories: Каиегории +search: Поиск +tags: Ключевые слова +tagcloud: Облако ключевых слов +tweets: Твиты +prev: Предыдущая +next: Следующая +comment: Комментарии +archive_a: Архив +archive_b: "Архив: %s" +page: Страница %d +recent_posts: Недавние записи \ No newline at end of file From df5a242163304196bea53cf2d7d68c33b8fcdad2 Mon Sep 17 00:00:00 2001 From: AV <av@example.com> Date: Fri, 8 Jan 2016 17:49:46 +0300 Subject: [PATCH 2/7] Add some language variable includes. Fix translation. --- languages/ru.yml | 2 +- layout/_partial/archive.ejs | 4 ++-- layout/_partial/article.ejs | 2 +- layout/_partial/header.ejs | 2 +- layout/_widget/archive.ejs | 2 +- layout/_widget/category.ejs | 2 +- layout/_widget/recent_posts.ejs | 2 +- layout/_widget/tag.ejs | 2 +- layout/_widget/tagcloud.ejs | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/languages/ru.yml b/languages/ru.yml index 065957ae86..fad6ba75c7 100644 --- a/languages/ru.yml +++ b/languages/ru.yml @@ -1,4 +1,4 @@ -categories: Каиегории +categories: Категории search: Поиск tags: Ключевые слова tagcloud: Облако ключевых слов diff --git a/layout/_partial/archive.ejs b/layout/_partial/archive.ejs index 2a0581f3fc..7d7c8baddd 100644 --- a/layout/_partial/archive.ejs +++ b/layout/_partial/archive.ejs @@ -26,8 +26,8 @@ <% if (page.total > 1){ %> <nav id="page-nav"> <%- paginator({ - prev_text: '« Prev', - next_text: 'Next »' + prev_text: "« __('prev')", + next_text: "__('next') »" }) %> </nav> <% } %> \ No newline at end of file diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs index 84efe9c91f..546941b812 100644 --- a/layout/_partial/article.ejs +++ b/layout/_partial/article.ejs @@ -25,7 +25,7 @@ <footer class="article-footer"> <a data-url="<%- post.permalink %>" data-id="<%= post._id %>" class="article-share-link">Share</a> <% if (post.comments && config.disqus_shortname){ %> - <a href="<%- post.permalink %>#disqus_thread" class="article-comment-link">Comments</a> + <a href="<%- post.permalink %>#disqus_thread" class="article-comment-link"><%= __('comment') %></a> <% } %> <%- partial('post/tag') %> </footer> diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index d536d10fc6..9df0c67776 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -22,7 +22,7 @@ <% if (theme.rss){ %> <a id="nav-rss-link" class="nav-icon" href="<%- theme.rss %>" title="RSS Feed"></a> <% } %> - <a id="nav-search-btn" class="nav-icon" title="Search"></a> + <a id="nav-search-btn" class="nav-icon" title="<%= __('search') %>"></a> </nav> <div id="search-form-wrap"> <%- search_form({button: ''}) %> diff --git a/layout/_widget/archive.ejs b/layout/_widget/archive.ejs index 56a24089e8..a20c58cc6f 100644 --- a/layout/_widget/archive.ejs +++ b/layout/_widget/archive.ejs @@ -1,6 +1,6 @@ <% if (site.posts.length){ %> <div class="widget-wrap"> - <h3 class="widget-title">Archives</h3> + <h3 class="widget-title"><%= __('archive_a') %></h3> <div class="widget"> <%- list_archives({show_count: theme.show_count, type: theme.archive_type}) %> </div> diff --git a/layout/_widget/category.ejs b/layout/_widget/category.ejs index e85bc5d89c..8d9e5e9edf 100644 --- a/layout/_widget/category.ejs +++ b/layout/_widget/category.ejs @@ -1,6 +1,6 @@ <% if (site.categories.length){ %> <div class="widget-wrap"> - <h3 class="widget-title">Categories</h3> + <h3 class="widget-title"><%= __('categories') %></h3> <div class="widget"> <%- list_categories({show_count: theme.show_count}) %> </div> diff --git a/layout/_widget/recent_posts.ejs b/layout/_widget/recent_posts.ejs index 77809202ae..7a38547db7 100644 --- a/layout/_widget/recent_posts.ejs +++ b/layout/_widget/recent_posts.ejs @@ -1,6 +1,6 @@ <% if (site.posts.length){ %> <div class="widget-wrap"> - <h3 class="widget-title">Recents</h3> + <h3 class="widget-title"><%= __('recent_posts') %></h3> <div class="widget"> <ul> <% site.posts.sort('date', -1).limit(5).each(function(post){ %> diff --git a/layout/_widget/tag.ejs b/layout/_widget/tag.ejs index ce9e8e8cdc..ea5fb2c1b7 100644 --- a/layout/_widget/tag.ejs +++ b/layout/_widget/tag.ejs @@ -1,6 +1,6 @@ <% if (site.tags.length){ %> <div class="widget-wrap"> - <h3 class="widget-title">Tags</h3> + <h3 class="widget-title"><%= __('tags') %></h3> <div class="widget"> <%- list_tags({show_count: theme.show_count}) %> </div> diff --git a/layout/_widget/tagcloud.ejs b/layout/_widget/tagcloud.ejs index 4b822835c6..5feb435aba 100644 --- a/layout/_widget/tagcloud.ejs +++ b/layout/_widget/tagcloud.ejs @@ -1,6 +1,6 @@ <% if (site.tags.length){ %> <div class="widget-wrap"> - <h3 class="widget-title">Tag Cloud</h3> + <h3 class="widget-title"><%= __('tagcloud') %></h3> <div class="widget tagcloud"> <%- tagcloud() %> </div> From b66fc18845ca08bde9a8ce4b443b622411b306bf Mon Sep 17 00:00:00 2001 From: AV <av@example.com> Date: Fri, 8 Jan 2016 18:09:26 +0300 Subject: [PATCH 3/7] Add newer/older variables. Fix translation. --- languages/default.yml | 4 +++- languages/ru.yml | 12 +++++++----- layout/_partial/post/nav.ejs | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/languages/default.yml b/languages/default.yml index f8c87cdd50..8a9368508d 100644 --- a/languages/default.yml +++ b/languages/default.yml @@ -9,4 +9,6 @@ comment: Comments archive_a: Archives archive_b: "Archives: %s" page: Page %d -recent_posts: Recent Posts \ No newline at end of file +recent_posts: Recent Posts +newer: Newer +older: Older \ No newline at end of file diff --git a/languages/ru.yml b/languages/ru.yml index fad6ba75c7..0c8c630a63 100644 --- a/languages/ru.yml +++ b/languages/ru.yml @@ -1,12 +1,14 @@ categories: Категории search: Поиск -tags: Ключевые слова -tagcloud: Облако ключевых слов +tags: Метки +tagcloud: Облако меток tweets: Твиты -prev: Предыдущая -next: Следующая +prev: Назад +next: Вперед comment: Комментарии archive_a: Архив archive_b: "Архив: %s" page: Страница %d -recent_posts: Недавние записи \ No newline at end of file +recent_posts: Недавние записи +newer: Следующий +older: Предыдущий \ No newline at end of file diff --git a/layout/_partial/post/nav.ejs b/layout/_partial/post/nav.ejs index 0406e5b8bb..720798a6f8 100644 --- a/layout/_partial/post/nav.ejs +++ b/layout/_partial/post/nav.ejs @@ -2,7 +2,7 @@ <nav id="article-nav"> <% if (post.prev){ %> <a href="<%- url_for(post.prev.path) %>" id="article-nav-newer" class="article-nav-link-wrap"> - <strong class="article-nav-caption">Newer</strong> + <strong class="article-nav-caption"><%= __('newer') %></strong> <div class="article-nav-title"> <% if (post.prev.title){ %> <%= post.prev.title %> @@ -14,7 +14,7 @@ <% } %> <% if (post.next){ %> <a href="<%- url_for(post.next.path) %>" id="article-nav-older" class="article-nav-link-wrap"> - <strong class="article-nav-caption">Older</strong> + <strong class="article-nav-caption"><%= __('older') %></strong> <div class="article-nav-title"><%= post.next.title %></div> </a> <% } %> From 8dda4efdbc51ef119af52376350459d08e0202bb Mon Sep 17 00:00:00 2001 From: AV <av@example.com> Date: Fri, 8 Jan 2016 18:18:14 +0300 Subject: [PATCH 4/7] Add powered by variable. --- languages/default.yml | 3 ++- languages/ru.yml | 3 ++- layout/_partial/footer.ejs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/languages/default.yml b/languages/default.yml index 8a9368508d..25513994d7 100644 --- a/languages/default.yml +++ b/languages/default.yml @@ -11,4 +11,5 @@ archive_b: "Archives: %s" page: Page %d recent_posts: Recent Posts newer: Newer -older: Older \ No newline at end of file +older: Older +powered_by: Powered by \ No newline at end of file diff --git a/languages/ru.yml b/languages/ru.yml index 0c8c630a63..2515b298cf 100644 --- a/languages/ru.yml +++ b/languages/ru.yml @@ -11,4 +11,5 @@ archive_b: "Архив: %s" page: Страница %d recent_posts: Недавние записи newer: Следующий -older: Предыдущий \ No newline at end of file +older: Предыдущий +powered_by: Создано с помощью \ No newline at end of file diff --git a/layout/_partial/footer.ejs b/layout/_partial/footer.ejs index 902d39c0fb..3aca6187d8 100644 --- a/layout/_partial/footer.ejs +++ b/layout/_partial/footer.ejs @@ -5,7 +5,7 @@ <div class="outer"> <div id="footer-info" class="inner"> © <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %><br> - Powered by <a href="http://hexo.io/" target="_blank">Hexo</a> + <%= __('powered_by') %> <a href="http://hexo.io/" target="_blank">Hexo</a> </div> </div> </footer> \ No newline at end of file From ea27f82a63e69575d61c579d9a4e154ed00d8f79 Mon Sep 17 00:00:00 2001 From: AV <av@example.com> Date: Fri, 8 Jan 2016 18:22:07 +0300 Subject: [PATCH 5/7] Add share variable. --- languages/default.yml | 1 + languages/ru.yml | 1 + layout/_partial/article.ejs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/languages/default.yml b/languages/default.yml index 25513994d7..dbdc56add7 100644 --- a/languages/default.yml +++ b/languages/default.yml @@ -12,4 +12,5 @@ page: Page %d recent_posts: Recent Posts newer: Newer older: Older +share: Share powered_by: Powered by \ No newline at end of file diff --git a/languages/ru.yml b/languages/ru.yml index 2515b298cf..9842db48ce 100644 --- a/languages/ru.yml +++ b/languages/ru.yml @@ -12,4 +12,5 @@ page: Страница %d recent_posts: Недавние записи newer: Следующий older: Предыдущий +share: Поделиться powered_by: Создано с помощью \ No newline at end of file diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs index 546941b812..0f951a9026 100644 --- a/layout/_partial/article.ejs +++ b/layout/_partial/article.ejs @@ -23,7 +23,7 @@ <% } %> </div> <footer class="article-footer"> - <a data-url="<%- post.permalink %>" data-id="<%= post._id %>" class="article-share-link">Share</a> + <a data-url="<%- post.permalink %>" data-id="<%= post._id %>" class="article-share-link"><%= __('share') %></a> <% if (post.comments && config.disqus_shortname){ %> <a href="<%- post.permalink %>#disqus_thread" class="article-comment-link"><%= __('comment') %></a> <% } %> From ba8c21fa0d9bf73816415c60e421957debd03438 Mon Sep 17 00:00:00 2001 From: AV <av@example.com> Date: Fri, 8 Jan 2016 18:36:51 +0300 Subject: [PATCH 6/7] Add title and rss translation. --- languages/default.yml | 5 ++++- languages/ru.yml | 5 ++++- layout/_partial/head.ejs | 6 +++--- layout/_partial/header.ejs | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/languages/default.yml b/languages/default.yml index dbdc56add7..3ef7e921c9 100644 --- a/languages/default.yml +++ b/languages/default.yml @@ -13,4 +13,7 @@ recent_posts: Recent Posts newer: Newer older: Older share: Share -powered_by: Powered by \ No newline at end of file +powered_by: Powered by +rss_feed: RSS Feed +category: Category +tag: Tag \ No newline at end of file diff --git a/languages/ru.yml b/languages/ru.yml index 9842db48ce..625a83c2aa 100644 --- a/languages/ru.yml +++ b/languages/ru.yml @@ -13,4 +13,7 @@ recent_posts: Недавние записи newer: Следующий older: Предыдущий share: Поделиться -powered_by: Создано с помощью \ No newline at end of file +powered_by: Создано с помощью +rss_feed: RSS-каналы +category: Категория +tag: Метка \ No newline at end of file diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 5678b187f8..5288d16053 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -6,7 +6,7 @@ var title = page.title; if (is_archive()){ - title = 'Archives'; + title = __('archive_a'); if (is_month()){ title += ': ' + page.year + '/' + page.month; @@ -14,9 +14,9 @@ title += ': ' + page.year; } } else if (is_category()){ - title = 'Category: ' + page.category; + title = __('category') + ': ' + page.category; } else if (is_tag()){ - title = 'Tag: ' + page.tag; + title = __('tag') + ': ' + page.tag; } %> <title><% if (title){ %><%= title %> | <% } %><%= config.title %></title> diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index 9df0c67776..aa4aad6f5c 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -20,7 +20,7 @@ </nav> <nav id="sub-nav"> <% if (theme.rss){ %> - <a id="nav-rss-link" class="nav-icon" href="<%- theme.rss %>" title="RSS Feed"></a> + <a id="nav-rss-link" class="nav-icon" href="<%- theme.rss %>" title="<%= __('rss_feed') %>"></a> <% } %> <a id="nav-search-btn" class="nav-icon" title="<%= __('search') %>"></a> </nav> From ce89428c46fc2fde7c49400cbdc45ca37d0f3f1a Mon Sep 17 00:00:00 2001 From: AV <av@example.com> Date: Fri, 8 Jan 2016 18:48:49 +0300 Subject: [PATCH 7/7] Add not translated variables to other languages. --- languages/no.yml | 7 +++++++ languages/zh-CN.yml | 9 ++++++++- languages/zh-TW.yml | 9 ++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/languages/no.yml b/languages/no.yml index dc99a056e0..b997691c43 100644 --- a/languages/no.yml +++ b/languages/no.yml @@ -10,3 +10,10 @@ archive_a: Arkiv archive_b: "Arkiv: %s" page: Side %d recent_posts: Siste innlegg +newer: Newer +older: Older +share: Share +powered_by: Powered by +rss_feed: RSS Feed +category: Category +tag: Tag \ No newline at end of file diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index db644078c2..51e13212e2 100644 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -9,4 +9,11 @@ comment: 留言 archive_a: 归档 archive_b: 归档:%s page: 第 %d 页 -recent_posts: 最新文章 \ No newline at end of file +recent_posts: 最新文章 +newer: Newer +older: Older +share: Share +powered_by: Powered by +rss_feed: RSS Feed +category: Category +tag: Tag \ No newline at end of file diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index a33a15e7d2..76d291619f 100644 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -9,4 +9,11 @@ comment: 留言 archive_a: 彙整 archive_b: 彙整:%s page: 第 %d 頁 -recent_posts: 最新文章 \ No newline at end of file +recent_posts: 最新文章 +newer: Newer +older: Older +share: Share +powered_by: Powered by +rss_feed: RSS Feed +category: Category +tag: Tag \ No newline at end of file