Skip to content

Commit

Permalink
0.5.6 新增功能汉化
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Dec 5, 2014
1 parent e1d5173 commit a9efa57
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 30 deletions.
4 changes: 1 addition & 3 deletions config.example.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ config = {
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
},

tagsUI: true,
codeInjectionUI: true,
},

Expand Down Expand Up @@ -69,7 +68,6 @@ config = {
contentPath: path.join(__dirname, '/content/')
}

tagsUI: true,
codeInjectionUI: true,
},

Expand Down
2 changes: 1 addition & 1 deletion core/client/controllers/settings/code-injection.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var SettingsCodeInjectionController = Ember.ObjectController.extend({

return this.get('model').save().then(function (model) {
self.notifications.closePassive();
self.notifications.showSuccess('Settings successfully saved.');
self.notifications.showSuccess('配置保存成功。');

return model;
}).catch(function (errors) {
Expand Down
10 changes: 5 additions & 5 deletions core/client/controllers/settings/labs.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
var LabsController = Ember.Controller.extend(Ember.Evented, {
uploadButtonText: 'Import',
uploadButtonText: '导入',
importErrors: '',

actions: {
onUpload: function (file) {
var self = this,
formData = new FormData();

this.set('uploadButtonText', 'Importing');
this.set('uploadButtonText', '导入');
this.notifications.closePassive();

formData.append('importfile', file);
Expand All @@ -20,15 +20,15 @@ var LabsController = Ember.Controller.extend(Ember.Evented, {
contentType: false,
processData: false
}).then(function () {
self.notifications.showSuccess('Import successful.');
self.notifications.showSuccess('导入成功');
}).catch(function (response) {
if (response && response.jqXHR && response.jqXHR.responseJSON && response.jqXHR.responseJSON.errors) {
self.set('importErrors', response.jqXHR.responseJSON.errors);
}

self.notifications.showError('Import Failed');
self.notifications.showError('导入失败');
}).finally(function () {
self.set('uploadButtonText', 'Import');
self.set('uploadButtonText', '导入');
self.trigger('reset');
});
},
Expand Down
6 changes: 3 additions & 3 deletions core/client/templates/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
{{/if}}

{{#if showTags}}
{{gh-activating-list-item route="settings.tags" title="Tags" classNames="settings-nav-tags icon-tag"}}
{{gh-activating-list-item route="settings.tags" title="标签管理" classNames="settings-nav-tags icon-tag"}}
{{/if}}

{{#if showCodeInjection}}
{{gh-activating-list-item route="settings.code-injection" title="Code Injection" classNames="settings-nav-code icon-code"}}
{{gh-activating-list-item route="settings.code-injection" title="自定义代码" classNames="settings-nav-code icon-code"}}
{{/if}}

{{#if showLabs}}
{{gh-activating-list-item route="settings.labs" title="Labs" classNames="settings-nav-labs icon-atom"}}
{{gh-activating-list-item route="settings.labs" title="实验室" classNames="settings-nav-labs icon-atom"}}
{{/if}}

{{#if showAbout}}
Expand Down
16 changes: 8 additions & 8 deletions core/client/templates/settings/code-injection.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<header class="settings-view-header">
{{#link-to "settings" class="btn btn-default btn-back"}}Back{{/link-to}}
<h2 class="page-title">Code Injection</h2>
{{#link-to "settings" class="btn btn-default btn-back"}}返回{{/link-to}}
<h2 class="page-title">自定义代码</h2>
<section class="page-actions">
<button type="button" class="btn btn-blue" {{action "save"}}>Save</button>
<button type="button" class="btn btn-blue" {{action "save"}}>保存</button>
</section>
</header>

Expand All @@ -11,19 +11,19 @@
<fieldset>
<div class="form-group">
<p>
Ghost allows you to inject code into the top and bottom of your template files without editing them. This allows for quick modifications to insert useful things like tracking codes and meta data.
这里可以插入HTML代码到网页的头部或尾部。比如你可以插入搜索引擎优化代码、第三方统计代码等等。
</p>
</div>

<div class="form-group">
<label for="ghost-head">Blog Header</label>
<p>Code here will be injected to the \{{ghost_head}} helper at the top of your page</p>
<label for="ghost-head">网页头部</label>
<p>这部分代码将插入到 &lt;head&gt; &lt;/head&gt; 标签之间</p>
{{textarea id="ghost-head" name="codeInjection[ghost_head]" type="text" value=ghost_head}}
</div>

<div class="form-group">
<label for="ghost-foot">Blog Footer</label>
<p>Code here will be injected to the \{{ghost_foot}} helper at the bottom of your page</p>
<label for="ghost-foot">网页尾部</label>
<p>这部分代码将插入到页尾</p>
{{textarea id="ghost-foot" name="codeInjection[ghost_foot]" type="text" value=ghost_foot}}
</div>
</fieldset>
Expand Down
9 changes: 9 additions & 0 deletions core/client/templates/settings/general.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@
<a href="http://tongji.baidu.com/" target="_blank"> 百度统计</a>
</p>
</div>


<div class="form-group tongji-container">
<label for="blog-tongji">站点地图</label>
<p>
<a href="/sitemap-index.xml" target="_blank">查看站点地图</a>
将站点地图提交到搜索引擎,可以获得更好的收录效果。
</p>
</div>
</fieldset>
</form>
</section>
17 changes: 10 additions & 7 deletions core/client/templates/settings/labs.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<header class="settings-view-header">
<h2 class="page-title">Labs</h2>
<h2 class="page-title">实验室</h2>
<div class="js-settings-header-inner settings-header-inner">
{{#link-to 'settings' class='btn btn-default btn-back'}}Back{{/link-to}}
{{#link-to 'settings' class='btn btn-default btn-back'}}返回{{/link-to}}
</div>
</header>

Expand All @@ -10,22 +10,24 @@
<form id="settings-export">
<fieldset>
<div class="form-group">
<label>Export</label>
<button type="button" class="btn btn-blue" {{action "exportData"}}>Export</button>
<p>Export the blog settings and data.</p>
<label>数据导出</label>
<button type="button" class="btn btn-blue" {{action "exportData"}}>导出</button>
<p>导出博客配置和博文数据。</p>
</div>
</fieldset>
</form>
{{#gh-form id="settings-import" enctype="multipart/form-data"}}
<fieldset>
<div class="form-group">
<label>Import</label>
<label>数据导入</label>
{{partial "import-errors"}}
{{gh-file-upload id="importfile" uploadButtonText=uploadButtonText}}
<p>Import from another Ghost installation. If you import a user, this will replace the current user & log you out.</p>
<p>导入博客配置和博文数据。注意:如导入数据中包含用户信息,用户信息会被覆盖,你可能将无法登录。</p>
</div>
</fieldset>
{{/gh-form}}

<!--
<form id="settings-resetdb">
<fieldset>
<div class="form-group">
Expand All @@ -44,4 +46,5 @@
</div>
</fieldset>
</form>
-->
</section>
6 changes: 3 additions & 3 deletions core/client/templates/settings/tags.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<header class="settings-view-header">
<a class="btn btn-default btn-back active" href="/ghost/settings/">Back</a>
<h2 class="page-title">Tags</h2>
<a class="btn btn-default btn-back active" href="/ghost/settings/">返回</a>
<h2 class="page-title">标签管理</h2>
<section class="page-actions">
<button type="button" class="btn btn-green" {{action "newTag"}}>New Tag</button>
<button type="button" class="btn btn-green" {{action "newTag"}}>新建</button>
</section>
</header>

Expand Down

0 comments on commit a9efa57

Please sign in to comment.