From 2b450e5212cbd082169515efce060fbfe1d3944c Mon Sep 17 00:00:00 2001 From: ppoffice Date: Thu, 7 Apr 2016 10:45:17 +0800 Subject: [PATCH] feat: add translations for insight search --- languages/en.yml | 7 +++++++ languages/es.yml | 6 ++++++ languages/fr.yml | 6 ++++++ languages/id.yml | 6 ++++++ languages/ja.yml | 6 ++++++ languages/ko.yml | 6 ++++++ languages/ru.yml | 6 ++++++ languages/zh-CN.yml | 6 ++++++ languages/zh-TW.yml | 6 ++++++ layout/search/insight.ejs | 7 +++---- 10 files changed, 58 insertions(+), 4 deletions(-) diff --git a/languages/en.yml b/languages/en.yml index 688d02d..b13e744 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -28,3 +28,10 @@ profile: tag: 'tag' posts: 'posts' tags: 'tags' +insight: + hint: 'Type something...' + posts: 'Posts' + pages: 'Pages' + categories: 'Categories' + tags: 'Tags' + diff --git a/languages/es.yml b/languages/es.yml index dfa7ccf..9ef59dc 100644 --- a/languages/es.yml +++ b/languages/es.yml @@ -28,3 +28,9 @@ profile: tag: 'Etiqueta' posts: 'Entradas' tags: 'Etiquetas' +insight: + hint: 'Type something...' + posts: 'Entradas' + pages: 'Pages' + categories: 'Categorias' + tags: 'Etiquetas' diff --git a/languages/fr.yml b/languages/fr.yml index 7aa0c09..e9411e0 100644 --- a/languages/fr.yml +++ b/languages/fr.yml @@ -27,3 +27,9 @@ profile: tag: 'Tag' posts: 'Articles' tags: 'Tags' +insight: + hint: 'Type something...' + posts: 'Articles' + pages: 'Pages' + categories: 'Catégories' + tags: 'Tags' diff --git a/languages/id.yml b/languages/id.yml index abda549..d4814fb 100644 --- a/languages/id.yml +++ b/languages/id.yml @@ -26,3 +26,9 @@ profile: tag: 'tag' posts: 'pos' tags: 'tag' +insight: + hint: 'Type something...' + posts: 'pos' + pages: 'Pages' + categories: 'kategori' + tags: 'tag' diff --git a/languages/ja.yml b/languages/ja.yml index b92bd98..3152d1d 100644 --- a/languages/ja.yml +++ b/languages/ja.yml @@ -27,3 +27,9 @@ profile: tag: 'タグ' posts: '投稿' tags: 'タグ' +insight: + hint: 'Type something...' + posts: '投稿' + pages: 'Pages' + categories: 'カテゴリ' + tags: 'タグ' diff --git a/languages/ko.yml b/languages/ko.yml index f5ecdc7..50535ec 100644 --- a/languages/ko.yml +++ b/languages/ko.yml @@ -28,3 +28,9 @@ profile: tag: '태그' posts: '포스트' tags: '태그' +insight: + hint: 'Type something...' + posts: '포스트' + pages: 'Pages' + categories: '카테고리' + tags: '태그' diff --git a/languages/ru.yml b/languages/ru.yml index 152dfd3..76ca98e 100644 --- a/languages/ru.yml +++ b/languages/ru.yml @@ -28,3 +28,9 @@ profile: tag: 'тэг' posts: 'посты' tags: 'тэги' +insight: + hint: 'Type something...' + posts: 'посты' + pages: 'Pages' + categories: 'категории' + tags: 'тэги' diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index eabc7da..8823250 100644 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -28,3 +28,9 @@ profile: tag: '标签' posts: '文章' tags: '标签' +insight: + hint: '想要查找什么...' + posts: '文章' + pages: '页面' + categories: '分类' + tags: '标签' diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 9f357c6..13409e8 100644 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -27,3 +27,9 @@ profile: tag: '標籤' posts: '文章' tags: '標籤' +insight: + hint: 'Type something...' + posts: '文章' + pages: 'Pages' + categories: '分類' + tags: '標籤' diff --git a/layout/search/insight.ejs b/layout/search/insight.ejs index 7231368..26ca74a 100644 --- a/layout/search/insight.ejs +++ b/layout/search/insight.ejs @@ -2,7 +2,7 @@
- +
@@ -47,7 +47,7 @@ switch (type) { case 'POSTS': case 'PAGES': - sectionTitle = type == 'POSTS' ? 'Posts' : 'Pages'; + sectionTitle = type == 'POSTS' ? '<%= __("insight.posts") %>' : '<%= __("insight.pages") %>'; $searchItems = array.map(function (item) { // Use config.root instead of permalink to fix url issue return searchItem('file', item.title, null, item.text.slice(0, 150), <%= config.root %> + item.path); @@ -55,7 +55,7 @@ break; case 'CATEGORIES': case 'TAGS': - sectionTitle = type == 'CATEGORIES' ? 'Categories' : 'Tags'; + sectionTitle = type == 'CATEGORIES' ? '<%= __("insight.categories") %>' : '<%= __("insight.tags") %>'; $searchItems = array.map(function (item) { return searchItem(type == 'CATEGORIES' ? 'folder' : 'tag', item.name, item.slug, null, item.permalink); }); @@ -190,7 +190,6 @@ } $.getJSON('<%- url_for("/content.json")%>', function (json) { - console.log(json) $('.ins-search-input').on('input', function () { var keywords = $(this).val(); searchResultToDOM(search(json, keywords));