feat: add translations for insight search

This commit is contained in:
ppoffice 2016-04-07 10:45:17 +08:00
parent 56b701b9bd
commit 2b450e5212
10 changed files with 58 additions and 4 deletions

View File

@ -28,3 +28,10 @@ profile:
tag: 'tag'
posts: 'posts'
tags: 'tags'
insight:
hint: 'Type something...'
posts: 'Posts'
pages: 'Pages'
categories: 'Categories'
tags: 'Tags'

View File

@ -28,3 +28,9 @@ profile:
tag: 'Etiqueta'
posts: 'Entradas'
tags: 'Etiquetas'
insight:
hint: 'Type something...'
posts: 'Entradas'
pages: 'Pages'
categories: 'Categorias'
tags: 'Etiquetas'

View File

@ -27,3 +27,9 @@ profile:
tag: 'Tag'
posts: 'Articles'
tags: 'Tags'
insight:
hint: 'Type something...'
posts: 'Articles'
pages: 'Pages'
categories: 'Catégories'
tags: 'Tags'

View File

@ -26,3 +26,9 @@ profile:
tag: 'tag'
posts: 'pos'
tags: 'tag'
insight:
hint: 'Type something...'
posts: 'pos'
pages: 'Pages'
categories: 'kategori'
tags: 'tag'

View File

@ -27,3 +27,9 @@ profile:
tag: 'タグ'
posts: '投稿'
tags: 'タグ'
insight:
hint: 'Type something...'
posts: '投稿'
pages: 'Pages'
categories: 'カテゴリ'
tags: 'タグ'

View File

@ -28,3 +28,9 @@ profile:
tag: '태그'
posts: '포스트'
tags: '태그'
insight:
hint: 'Type something...'
posts: '포스트'
pages: 'Pages'
categories: '카테고리'
tags: '태그'

View File

@ -28,3 +28,9 @@ profile:
tag: 'тэг'
posts: 'посты'
tags: 'тэги'
insight:
hint: 'Type something...'
posts: 'посты'
pages: 'Pages'
categories: 'категории'
tags: 'тэги'

View File

@ -28,3 +28,9 @@ profile:
tag: '标签'
posts: '文章'
tags: '标签'
insight:
hint: '想要查找什么...'
posts: '文章'
pages: '页面'
categories: '分类'
tags: '标签'

View File

@ -27,3 +27,9 @@ profile:
tag: '標籤'
posts: '文章'
tags: '標籤'
insight:
hint: 'Type something...'
posts: '文章'
pages: 'Pages'
categories: '分類'
tags: '標籤'

View File

@ -2,7 +2,7 @@
<div class="ins-search-mask"></div>
<div class="ins-search-container">
<div class="ins-input-wrapper">
<input type="text" class="ins-search-input" placeholder="Type something..." />
<input type="text" class="ins-search-input" placeholder="<%= __('insight.hint') %>" />
<span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
</div>
<div class="ins-section-wrapper">
@ -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));