From 365ad3853c110d5e02ca9562b38dfaa72fc18eba Mon Sep 17 00:00:00 2001 From: life <lifephp@gmail.com> Date: Sat, 10 May 2014 16:01:50 +0800 Subject: [PATCH] blog i18n --- app/views/Blog/about_me.html | 2 +- app/views/Blog/footer.html | 14 ++++----- app/views/Blog/header.html | 6 ++-- app/views/Blog/highlight.html | 2 ++ app/views/Blog/index.html | 13 ++++---- app/views/Blog/set.html | 59 +++++++++++++++++------------------ app/views/Blog/view.html | 8 ++--- app/views/Home/index.html | 4 +-- app/views/Note/note-dev.html | 2 +- messages/blog.en | 41 ++++++++++++++++++++++++ messages/blog.zh | 41 ++++++++++++++++++++++++ messages/msg.en | 37 ++++++++++++---------- messages/msg.zh | 8 ++++- 13 files changed, 165 insertions(+), 72 deletions(-) create mode 100644 messages/blog.en create mode 100644 messages/blog.zh diff --git a/app/views/Blog/about_me.html b/app/views/Blog/about_me.html index 8032c75..e734d78 100644 --- a/app/views/Blog/about_me.html +++ b/app/views/Blog/about_me.html @@ -4,7 +4,7 @@ <div id="posts"> <div class="each-post"> <div class="title"> - 关于我 + {{msg . "aboutMe"}} </div> <div class="created-time"> </div> diff --git a/app/views/Blog/footer.html b/app/views/Blog/footer.html index 3af7a0d..84a19d2 100644 --- a/app/views/Blog/footer.html +++ b/app/views/Blog/footer.html @@ -2,19 +2,19 @@ {{$userId := .userBlog.UserId.Hex}} <div class="container" id="footer"> <div class="col-md-4"> - <h3>导航</h3> + <h3>{{msg . "blogNavs"}}</h3> <ul> - <li><a href="/blog/{{$userId}}">首页</a></li> + <li><a href="/blog/{{$userId}}">{{msg . "home"}}</a></li> {{range .notebooks}} <li> <a href="/blog/{{$userId}}/{{.NotebookId.Hex}}">{{.Title}}</a> </li> {{end}} - <li><a href="/blog/aboutMe/{{$userId}}">关于我</a></li> + <li><a href="/blog/aboutMe/{{$userId}}">{{msg . "aboutMe"}}</a></li> </ul> </div> <div class="col-md-4"> - <h3>最近发表</h3> + <h3>{{msg . "latestPosts"}}</h3> <ul> {{range .recentBlogs}} <li title="{{.Title}}"><a href="/blog/view/{{.NoteId.Hex}}/">{{.Title}}</a></li> @@ -22,10 +22,10 @@ </ul> </div> <div class="col-md-4"> - <h3>快速链接</h3> + <h3>{{msg . "quickLinks"}}</h3> <ul> - <li><a href="/note">我的笔记</a></li> - <li><a href="/login">登录</a></li> + <li><a href="/note">{{msg . "myNote"}}</a></li> + <li><a href="/login">{{msg . "login"}}</a></li> <li><a href="http://leanote.com" target="_blank">leanote</a></li> <li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li> </ul> diff --git a/app/views/Blog/header.html b/app/views/Blog/header.html index 7e340e3..49aa86b 100644 --- a/app/views/Blog/header.html +++ b/app/views/Blog/header.html @@ -58,7 +58,7 @@ function log(o) { <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> {{$navNotebookId := .notebookId}} - <li class="{{if .index}}active{{end}}"><a href="/blog/{{$username}}">首页</a></li> + <li class="{{if .index}}active{{end}}"><a href="/blog/{{$username}}">{{msg . "home"}}</a></li> {{range .notebooks}} {{$notebookId := .NotebookId.Hex}} <li class="{{if eq $navNotebookId $notebookId}}active{{else}}{{end}}"> @@ -66,9 +66,9 @@ function log(o) { >{{.Title}}</a> </li> {{end}} - <li class="{{if .aboutMe}}active{{end}}"><a href="/blog/aboutMe/{{$username}}">关于我</a></li> + <li class="{{if .aboutMe}}active{{end}}"><a href="/blog/aboutMe/{{$username}}">{{msg . "aboutMe"}}</a></li> {{if .isMe}} - <li class="{{if .set}}active{{end}}"><a href="/blog/set" >博客设置</a></li> + <li class="{{if .set}}active{{end}}"><a href="/blog/set">{{msg . "blogSet"}}</a></li> <li><a href="/note" >{{msg . "myNote"}}</a></li> {{end}} </ul> diff --git a/app/views/Blog/highlight.html b/app/views/Blog/highlight.html index 2531f2f..84de595 100644 --- a/app/views/Blog/highlight.html +++ b/app/views/Blog/highlight.html @@ -1,3 +1,5 @@ +<!-- This file is Depreciated --> + <link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet"> <script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script> diff --git a/app/views/Blog/index.html b/app/views/Blog/index.html index 993ddba..dcb4d54 100644 --- a/app/views/Blog/index.html +++ b/app/views/Blog/index.html @@ -3,14 +3,15 @@ <div id="postsContainer"> <div class="container"> {{if .notebookId}} - <h2>分类 {{.notebook.Title}}</h2> + <h2>{{msg . "blogClass"}}: {{.notebook.Title}}</h2> {{end}} </div> <div id="posts"> + {{$G := .}} {{range .blogs}} <div class="each-post"> <div class="title"> - <a href="/blog/view/{{.NoteId.Hex}}" title="全文"> + <a href="/blog/view/{{.NoteId.Hex}}" title="{{msg $G "fullBlog"}}"> {{.Title}} </a> </div> @@ -19,16 +20,16 @@ {{if .Tags}} {{blogTags .Tags}} {{else}} - 无 + {{msg $G "noTag"}} {{end}} | - <i class="fa fa-calendar" style="color: #666"></i> 更新 {{.UpdatedTime | datetime}} | - <i class="fa fa-calendar" style="color: #666"></i> 创建 {{.CreatedTime | datetime}} + <i class="fa fa-calendar" style="color: #666"></i> {{msg $G "updatedTime"}} {{.UpdatedTime | datetime}} | + <i class="fa fa-calendar" style="color: #666"></i> {{msg $G "createdTime"}} {{.CreatedTime | datetime}} </div> <div class="desc"> {{.Content | raw}} </div> - <a class="more" href="/blog/view/{{.NoteId.Hex}}" title="更多">More...</a> + <a class="more" href="/blog/view/{{.NoteId.Hex}}" title="{{msg $G "fullBlog"}}">More...</a> </div> {{end}} <!-- 分页 --> diff --git a/app/views/Blog/set.html b/app/views/Blog/set.html index 4505005..a261041 100644 --- a/app/views/Blog/set.html +++ b/app/views/Blog/set.html @@ -1,8 +1,7 @@ {{template "Blog/header.html" .}} <!-- --> -<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" - type="text/css"> +<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css"> <style> .tab-pane { padding-top: 10px; @@ -11,9 +10,9 @@ <div id="postsContainer"> <div id="posts"> <ul id="myTab" class="nav nav-tabs"> - <li class="active"><a href="#baseInfo" data-toggle="tab">基本设置</a></li> - <li class=""><a href="#commentInfo" data-toggle="tab">评论设置</a></li> - <li class=""><a href="#styleInfo" data-toggle="tab">主题设置</a></li> + <li class="active"><a href="#baseInfo" data-toggle="tab">{{msg . "baseInfoSet"}}</a></li> + <li class=""><a href="#commentInfo" data-toggle="tab">{{msg . "commentSet"}}</a></li> + <li class=""><a href="#styleInfo" data-toggle="tab">{{msg . "themeSet"}}</a></li> </ul> <!-- Tab panes --> @@ -21,7 +20,7 @@ <div class="tab-pane" id="styleInfo"> <form class="form-horizontal" role="form"> <div class="form-group"> - <label for="Style" class="col-sm-2 control-label">主题</label> + <label for="Style" class="col-sm-2 control-label">{{msg . "theme"}}</label> <div class="col-sm-10"> <label><input type="radio" name="Style" value="blog_default" @@ -32,19 +31,19 @@ checked="checked" {{end}} {{end}}> - 默认 </label> + {{msg . "default"}} </label> <label><input type="radio" name="Style" value="blog_daqi" {{if eq .userBlog.Style "blog_daqi"}}checked="checked"{{end}}> - 大气</label> + {{msg . "elegant"}}</label> <label><input type="radio" name="Style" value="blog_left_fixed" {{if eq .userBlog.Style "blog_left_fixed"}}checked="checked"{{end}}> - 左侧导航固定</label> + {{msg . "navFixed"}}</label> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> - <button class="btn btn-success">保存</button> + <button class="btn btn-success">{{msg . "save"}}</button> <span class="msg"></span> </div> </div> @@ -54,26 +53,25 @@ <div class="tab-pane" id="commentInfo"> <form class="form-horizontal" role="form"> <div class="form-group"> - <label for="subTitle" class="col-sm-2 control-label">开启评论</label> + <label for="subTitle" class="col-sm-2 control-label">{{msg . "openComment"}}</label> <div class="col-sm-10"> <input type="checkbox" id="CanComment" name="CanComment" {{if .userBlog.CanComment}}checked="checked"{{end}} > <br /> - leanote采用 <a href="http://disqus.com" target="_blank">Disqus</a> - 作为评论系统 + {{msg . "commentSys"}} <div id="disqusSet"> <label for="DisqusId">Disqus Id</label> <input type="text" class="form-control" style="display: inline; width: 50%" id="DisqusId" name="DisqusId" value="{{if .userBlog.DisqusId}}{{.userBlog.DisqusId}}{{else}}leanote{{end}}"> - <br /> (请填写您申请的Disqus唯一url前缀, 建议您申请Disqus帐号, 这样可以自己管理评论. - 或使用leanote的默认Disqus Id. <a target="_blank" - href="/blog/view/52db8463e01c530ef8000001">需要帮助?</a>) + <br /> + {{msg . "disqusHelp"}} + <a target="_blank" href="http://leanote.com/blog/view/52db8463e01c530ef8000001">{{msg . "needHelp"}}</a>) </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> - <button class="btn btn-success">保存</button> + <button class="btn btn-success">{{msg . "save"}}</button> <span class="msg"></span> </div> </div> @@ -90,16 +88,16 @@ </div> </div> <div class="form-group"> - <label for="title" class="col-sm-2 control-label">博客名称</label> + <label for="title" class="col-sm-2 control-label">{{msg . "blogName"}}</label> <div class="col-sm-10"> <input type="text" class="form-control" id="Title" name="Title" - placeholder="比如: leanote的博客" - value="{{if .userBlog.Title}}{{.userBlog.Title}}{{else}}{{.userInfo.Email}} 的博客{{end}}"> + placeholder="eg: leanote's blog" + value="{{if .userBlog.Title}}{{.userBlog.Title}}{{else}}{{.userInfo.Email}} 's blog{{end}}"> </div> </div> <div class="form-group"> - <label for="logo" class="col-sm-2 control-label">博客Logo</label> + <label for="logo" class="col-sm-2 control-label">{{msg . "blogLogo"}}</label> <div class="col-sm-10"> <input type="hidden" name="Logo" id="Logo" value="{{.userBlog.Logo}}" /> @@ -107,14 +105,15 @@ enctype="multipart/form-data" target="logoTarget" onsubmit="inProgress()"> <input type="file" class="form-control" id="logo2" name="file" - onChange='$("#formLogo").submit();' /> 上传logo将显示logo(替代博客标题) + onChange='$("#formLogo").submit();' /> + {{msg . "blogLogoTips"}} <div id="logoImg" {{if .userBlog.Logo }} {{else}} style="display: none"{{end}} > <img src="{{.userBlog.Logo}}" style="height: 40px" /> <a - href="#" id="deleteLogo">删除</a> + href="#" id="deleteLogo">{{msg . "delete"}}</a> </div> </form> <iframe id="logoTarget" name="logoTarget" src="#" @@ -123,11 +122,11 @@ </div> <div class="form-group"> - <label for="subTitle" class="col-sm-2 control-label">博客描述</label> + <label for="subTitle" class="col-sm-2 control-label">{{msg . "blogDesc"}}</label> <div class="col-sm-10"> <input type="text" class="form-control" id="SubTitle" name="SubTitle" value="{{.userBlog.SubTitle}}" - placeholder="比如: leanote, 不只是笔记"> + placeholder="eg: leanote, your own cloud note"> </div> </div> @@ -139,7 +138,7 @@ </div> <div class="form-group"> - <label for="aboutMe" class="col-sm-2 control-label">关于我</label> + <label for="aboutMe" class="col-sm-2 control-label">{{msg . "aboutMe"}}</label> <div class="col-sm-10"> <textarea id="AboutMe" name="AboutMe">{{.userBlog.AboutMe}}</textarea> </div> @@ -147,7 +146,7 @@ <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> - <button class="btn btn-success">保存</button> + <button class="btn btn-success">{{msg . "save"}}</button> <span class="msg"></span> </div> </div> @@ -218,7 +217,7 @@ $(function() { } post("/blog/setUserBlogBase", data, function(ret) { - showMsg2($("#baseInfo .msg"), "保存成功", 2000); + showMsg2($("#baseInfo .msg"), "{{msg . "saveSuccess"}}", 2000); $("#blogDesc").html(data.SubTitle); $("#logo").html(data.Title); if(data.Logo) { @@ -234,7 +233,7 @@ $(function() { DisqusId : $("#DisqusId").val(), } post("/blog/setUserBlogComment", data, function(ret) { - showMsg2($("#commentInfo .msg"), "保存成功", 2000); + showMsg2($("#commentInfo .msg"), "{{msg . "saveSuccess"}}", 2000); }, this); }); // 主题 @@ -244,7 +243,7 @@ $(function() { Style : $("input[name='Style']:checked").val() } post("/blog/setUserBlogStyle", data, function(ret) { - showMsg2($("#styleInfo .msg"), "保存成功", 2000); + showMsg2($("#styleInfo .msg"), "{{msg . "saveSuccess"}}", 2000); }, this); }); $("input[name='Style']").click(function() { diff --git a/app/views/Blog/view.html b/app/views/Blog/view.html index 936bfe5..e850e6a 100644 --- a/app/views/Blog/view.html +++ b/app/views/Blog/view.html @@ -12,11 +12,11 @@ {{if .blog.Tags}} {{blogTags .blog.Tags}} {{else}} - 无 + {{msg . "noTag"}} {{end}} | - <i class="fa fa-calendar" style="color: #666"></i> 更新 {{.blog.UpdatedTime | datetime}} | - <i class="fa fa-calendar" style="color: #666"></i> 创建 {{.blog.CreatedTime | datetime}} + <i class="fa fa-calendar" style="color: #666"></i> {{msg . "updatedTime"}} {{.blog.UpdatedTime | datetime}} | + <i class="fa fa-calendar" style="color: #666"></i> {{msg . "createdTime"}} {{.blog.CreatedTime | datetime}} </div> <div class="desc" id="content"> @@ -93,7 +93,7 @@ <div id="blogNav"> <div id="blogNavNav"> <i class="fa fa-align-justify" title="文档导航"></i> - <span>{{msg . "nav"}}</span> + <span>{{msg . "blogNav"}}</span> </div> <div id="blogNavContent" style="max-width: 200px"> </div> diff --git a/app/views/Home/index.html b/app/views/Home/index.html index c24ae27..9c55b5e 100644 --- a/app/views/Home/index.html +++ b/app/views/Home/index.html @@ -4,11 +4,11 @@ </style> <section> <div class="header"> - <h2>leanote, Your own cloud note!</h2> + <h2>leanote, your own cloud note!</h2> <p>Knowledge, Sharing, Cooperation, Blog... all just in leanote</p> <div> - <a class="btn btn-primary" href="https://github.com/leanote/leanote">Fork leanote from Github</a> + <a class="btn btn-primary" href="https://github.com/leanote/leanote">Fork leanote on Github</a> <a class="btn btn-default" href="/demo">Try it</a> diff --git a/app/views/Note/note-dev.html b/app/views/Note/note-dev.html index d057b8a..b24537c 100644 --- a/app/views/Note/note-dev.html +++ b/app/views/Note/note-dev.html @@ -707,7 +707,7 @@ function log(o) { </div> </div> - <!-- 长微博 --> + <!-- 激活邮件 --> <div id="reSendActiveEmailDialog"> <div class="modal-body"> <div style="max-height: 300px; padding: 5px 0; text-align: center; overflow: scroll;" class="weibo"> diff --git a/messages/blog.en b/messages/blog.en new file mode 100644 index 0000000..a238632 --- /dev/null +++ b/messages/blog.en @@ -0,0 +1,41 @@ +# blog + +blog=Blog +aboutMe=About me +blogSet=Set blog + +blogNavs=Navs +quickLinks=Quick links +latestPosts=Latest posts + +noBlog=No blog +noTag=No tag +blogClass=Classification +updatedTime=Updated at +createdTime=Created at +fullBlog=Full blog +blogNav=Blog nav + +# +# set blog +# +baseInfoSet=Base info +commentSet=Comment +themeSet=Theme +theme=Theme +blogName=Title +blogLogo=Logo +blogDesc=Description + +# theme +elegant=Elegant +navFixed=Nav fixed at left side + +openComment=Open comment? +commentSys=leanote use <a href="http://disqus.com" target="_blank">Disqus</a> as comment system +disqusHelp=Please input your Disqus Id or use "leanote" +needHelp=Need help? +blogLogoTips=Upload image to replace blog title +saveSuccess=Save success + +a=a \ No newline at end of file diff --git a/messages/blog.zh b/messages/blog.zh new file mode 100644 index 0000000..86c0ae3 --- /dev/null +++ b/messages/blog.zh @@ -0,0 +1,41 @@ +# blog +blog=博客 +aboutMe=关于我 +blogSet=博客设置 + +blogNavs=导航 +quickLinks=快速链接 +latestPosts=最近发表 + +noBlog=无博客 +noTag=无 +blogClass=分类 +updatedTime=更新 +createdTime=创建 +fullBlog=全文 +blogNav=导航 + +# +# set blog +# +baseInfoSet=基本设置 +commentSet=评论设置 +themeSet=主题设置 +theme=主题 +blogName=博客标题 +blogLogo=博客Logo +blogDesc=博客描述 + +# theme +elegant=大气 +navFixed=导航左侧固定 + +openComment=开启评论? +commentSys=leanote 使用 <a href="http://disqus.com" target="_blank">Disqus</a> 作为评论系统 +disqusHelp=请填写您申请的Disqus唯一url前缀. 建议您申请Disqus帐号, 这样可以自己管理评论. 或使用leanote的默认Disqus Id. +needHelp=需要帮助? +blogLogoTips=上传logo将显示logo(替代博客标题) +saveSuccess=保存成功 + + +a=a \ No newline at end of file diff --git a/messages/msg.en b/messages/msg.en index ff4a71c..db5f443 100644 --- a/messages/msg.en +++ b/messages/msg.en @@ -1,5 +1,6 @@ # leanote -moto=Not just a note! +moto=your own cloud note! + # 首页 forgetPassword = Forget password? or=or @@ -26,7 +27,7 @@ emailOrOthers=Email or other contact way hi=Hi welcomeUseLeanote=Welcome! -myNote=Enter to my note +myNote=My note curUser=Email # form @@ -65,21 +66,21 @@ notGoodPassword=Tt's not a good password, the length is at least 6 myBlog=Blog history=Histories save=Save -editorTips=Editor Tips -editorTipsInfo=<h4>1. Short Cuts</h4>ctrl+shift+c Toggle code <br /> ctrl+shift+i Insert/edit image <h4>2. shift+enter Get out of current block</h4> eg. <img src="/images/outofcode.png" style="width: 90px"/> in this situation you can use shift+enter to get out of current code block. -newNote=New Note -newMarkdown=New Markdown Note +editorTips=Tips +editorTipsInfo=<h4>1. Short cuts</h4>ctrl+shift+c Toggle code <br /> ctrl+shift+i Insert/edit image <h4>2. shift+enter Get out of current block</h4> eg. <img src="/images/outofcode.png" style="width: 90px"/> in this situation you can use shift+enter to get out of current code block. +newNote=New note +newMarkdown=New markdown note clickAddTag=Click to add Tag notebook=Notebook -myNotebook=My Notebook -addNotebook=Add Notebook +myNotebook=My notebook +addNotebook=Add notebook all=Newest trash=Trash unTitled=UnTitled defaultShare=Default sharing leftHidden=Hidden slide bar leftShow=Show slide bar -nav=Note Nav +nav=Note nav update=Update create=Create @@ -92,7 +93,7 @@ send=Send # 标签 tag=Tag -myTag=My Tag +myTag=My tag red=red yellow=yellow blue=blue @@ -103,18 +104,20 @@ accountSetting=Account themeSetting=Theme logout=Logout basicInfo=Basic -updateEmail=Update Email -usernameSetting=Update Username -oldPassword=Old Password -newPassword=New Password +updateEmail=Update email +usernameSetting=Update username +oldPassword=Old password +newPassword=New password default=Default simple=Simple # tinymce -uploadImage=Upload Image +uploadImage=Upload image + +# blog +aboutMe=About me +blogSet=Set blog # error notFound=This page cann't found. - -a=a \ No newline at end of file diff --git a/messages/msg.zh b/messages/msg.zh index 24e6e9a..0bd9de8 100644 --- a/messages/msg.zh +++ b/messages/msg.zh @@ -27,7 +27,7 @@ emailOrOthers=Email或其它联系方式 hi=Hi welcomeUseLeanote=欢迎使用leanote -myNote=进入我的笔记 +myNote=我的笔记 curUser=当前登录帐户 # form @@ -116,8 +116,14 @@ simple=简约 # tinymce uploadImage=上传图片 +# blog +aboutMe=关于我 +blogSet=博客设置 + # error notFound=该页面不存在 + + # 必须要加这个, 奇怪 [CN] \ No newline at end of file