From 75e40a01c2e7863157a68827ed1a020c66cb16a6 Mon Sep 17 00:00:00 2001 From: lxy <1103069291@qq.com> Date: Sat, 5 Dec 2020 13:30:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20[#91]=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=9B=BD=E9=99=85=E5=8C=96=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=20=E5=AF=B9=E4=BA=8E=E4=B8=BB=E9=A2=98=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E5=AE=9E=E9=99=85=E4=B8=8A=E5=B9=B6=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E5=BE=88=E5=BF=85=E9=A1=BB=E7=9A=84=E4=B8=9C=E8=A5=BF?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E7=9B=AE=E5=89=8D=E6=97=A2=E7=84=B6=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E5=81=9A=E4=BA=86=EF=BC=8C=E5=B0=B1=E6=89=80=E5=B9=B8?= =?UTF-8?q?=E5=81=9A=E5=AE=8C=E4=BA=86=E3=80=82=20=E6=9C=AC=E6=AC=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=B1=89=E8=AF=AD=E7=AE=80=E4=BD=93?= =?UTF-8?q?=E7=9A=84=E5=9B=BD=E9=99=85=E5=8C=96=E6=96=87=E6=9C=AC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #91 --- 404.ftl | 29 +- README.md | 1 + archives.ftl | 14 +- bower.json | 4 +- categories.ftl | 14 +- category.ftl | 21 +- comments.ftl | 5 +- footer.ftl | 4 +- inc/decorate.ftl | 6 +- index.ftl | 19 +- journals.ftl | 17 +- languages/zh.yml | 97 + layouts/authorprofile.ftl | 8 +- layouts/feature.ftl | 59 +- layouts/imgbox.ftl | 85 +- layouts/list-nextprev.ftl | 21 + layouts/post-nextprev.ftl | 4 +- layouts/sharelike.ftl | 18 +- links.ftl | 5 +- mail_template/mail_reply.ftl | 6 +- package.json | 3 +- photos.ftl | 6 +- post.ftl | 2 +- script/app.js | 20 +- script/app.min.js | 2 +- script/i18n.js | 150 + script/i18n.min.js | 1 + search.ftl | 23 +- settings.yaml | 24 +- source/lib/jquery-i18n/jquery.i18n.js | 130 + source/lib/jquery-i18n/jquery.i18n.min.js | 1 + source/lib/js-yaml/.bower.json | 46 + source/lib/js-yaml/CHANGELOG.md | 551 +++ source/lib/js-yaml/LICENSE | 21 + source/lib/js-yaml/README.md | 299 ++ source/lib/js-yaml/bower.json | 29 + source/lib/js-yaml/dist/js-yaml.js | 3989 +++++++++++++++++++++ source/lib/js-yaml/dist/js-yaml.min.js | 1 + styles/style.css | 9 +- styles/style.css.map | 2 +- styles/style.min.css | 2 +- tag.ftl | 21 +- tags.ftl | 14 +- tpl/content-justify-photos.ftl | 10 +- tpl/content-links.ftl | 8 +- tpl/content-masonry-photos.ftl | 10 +- tpl/content-none.ftl | 6 +- tpl/content-single.ftl | 6 +- tpl/content-thumb.ftl | 6 +- tpl/content.ftl | 8 +- 50 files changed, 5644 insertions(+), 193 deletions(-) create mode 100644 languages/zh.yml create mode 100644 layouts/list-nextprev.ftl create mode 100644 script/i18n.js create mode 100644 script/i18n.min.js create mode 100644 source/lib/jquery-i18n/jquery.i18n.js create mode 100644 source/lib/jquery-i18n/jquery.i18n.min.js create mode 100644 source/lib/js-yaml/.bower.json create mode 100644 source/lib/js-yaml/CHANGELOG.md create mode 100644 source/lib/js-yaml/LICENSE create mode 100644 source/lib/js-yaml/README.md create mode 100644 source/lib/js-yaml/bower.json create mode 100644 source/lib/js-yaml/dist/js-yaml.js create mode 100644 source/lib/js-yaml/dist/js-yaml.min.js diff --git a/404.ftl b/404.ftl index ffd9317..6a20309 100644 --- a/404.ftl +++ b/404.ftl @@ -1,15 +1,17 @@ <#-- @package Akina --> +<#global res_base_url = settings.cdn?then("//cdn.jsdelivr.net/gh/LIlGG/halo-theme-sakura@1.2.1", theme_base)/> - Page not found - ${blog_title!} + <@global.head /> <#include "inc/decorate.ftl"> + @@ -18,20 +20,16 @@
- 返回上一页 - 返回主页 + +
-

- 别急,试试站内搜索? -

-

- Don't worry, search in site? -

+

+

@@ -45,6 +43,15 @@ } + + diff --git a/README.md b/README.md index 7f9a94f..bd97009 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ DEMO:[https://lixingyong.com/](https://lixingyong.com/) - [x] 全局提示&复制提醒功能 - [x] 相册 - [x] 说说 +- [x] 国际化 > Tip: >> 上述功能大部分均可配置。具体操作在 后台 -> 外观 -> 主题 -> 设置 中进行配置 diff --git a/archives.ftl b/archives.ftl index ede02c4..02838bd 100644 --- a/archives.ftl +++ b/archives.ftl @@ -2,7 +2,7 @@ @package Akina --> <#include "header.ftl"> -<@header title="文章归档 - ${blog_title!}"> +<@header title="${options.archives_title?default('文章归档')} - ${blog_title!}"> <#if (settings.patternimg!true) && (settings.archives_patternimg?? && settings.archives_patternimg!='')>
@@ -10,7 +10,11 @@
-

文章归档

+ <#if options.archives_title?default("")?trim?length gt 1> +

${options.archives_title}

+ <#else> +

+
<#else> @@ -20,7 +24,11 @@
<#if !(settings.patternimg!true) || !(settings.archives_patternimg?? && settings.archives_patternimg!='')> -

文章归档

+ <#if options.archives_title?default("")?trim?length gt 1> +

${options.archives_title}

+ <#else> +

+
<@postTag method="archiveMonth"> diff --git a/bower.json b/bower.json index 0dd5a79..ce42541 100644 --- a/bower.json +++ b/bower.json @@ -18,12 +18,10 @@ "dependencies": { "flv.min": "https://github.com/bilibili/flv.js/releases/download/v1.5.0/flv.min.js", "isotope.pkgd.min": "https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js", - "jquery.justifiedGallery.min": "https://github.com/miromannino/Justified-Gallery/blob/master/dist/js/jquery.justifiedGallery.min.js", "imagesloaded": "^4.1.4", "packery-mode.pkgd.min": "https://github.com/metafizzy/isotope-packery/blob/master/packery-mode.pkgd.min.js", - "APlayer.min": "https://github.com/MoePlayer/APlayer/blob/master/dist/APlayer.min.js", "tocbot": "^4.12.0", "jquery-ui": "^1.12.1", - "v1.10": "https://github.com/MoePlayer/APlayer/releases/tag/v1.10.1" + "js-yaml": "^3.14.0" } } diff --git a/categories.ftl b/categories.ftl index a7d2ed1..d872f2e 100644 --- a/categories.ftl +++ b/categories.ftl @@ -14,13 +14,21 @@
-

${options.categories_title?default('文章分类')}

+ <#if options.categories_title?default("")?trim?length gt 1> +

${options.categories_title}

+ <#else> +

+
<#else>
-

${options.categories_title?default('文章分类')}

+ <#if options.categories_title?default("")?trim?length gt 1> +

${options.categories_title}

+ <#else> +

+
@@ -29,7 +37,7 @@
-   文章分类 +   
<@categoryTag method="list"> diff --git a/category.ftl b/category.ftl index 7dc6430..43fd5df 100644 --- a/category.ftl +++ b/category.ftl @@ -10,7 +10,7 @@
-

分类:${category.name!}

+

${category.description!}
@@ -39,24 +39,7 @@ <@paginationTag method="categoryPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${category.slug!}"> - <#if (settings.pagenav_style!'ajax') == 'ajax'> - - <#else> - - + <#include "layouts/list-nextprev.ftl">
<#include "footer.ftl"> diff --git a/comments.ftl b/comments.ftl index e36d991..4d71e36 100644 --- a/comments.ftl +++ b/comments.ftl @@ -12,7 +12,10 @@ <#if !target.disallowComment!false>
-

Comments | ${target.commentCount!0} 条评论

+

+ + +

diff --git a/footer.ftl b/footer.ftl index 61c4ed6..310ab59 100644 --- a/footer.ftl +++ b/footer.ftl @@ -173,6 +173,7 @@ "tagRandomColorMax": "${settings.tag_randomColorMax!0.969}", "nickname": "${user.nickname!}", "sitename": "${blog_title!}", + "themeBase": "${theme_base!}", "openToast": "${(settings.open_toast!true)?string('true','')}", "toastWidth": ${settings.toast_width!}, "toastHeight": ${settings.toast_height!}, @@ -254,7 +255,8 @@ - + + <#nested /> <#if settings.live2d_switch!true> diff --git a/inc/decorate.ftl b/inc/decorate.ftl index 185690f..09d988d 100644 --- a/inc/decorate.ftl +++ b/inc/decorate.ftl @@ -44,15 +44,15 @@ } #pagination .loading { - background: url(${res_base_url!}/source/images/rotating-ball-o.svg); + background-image: url(${res_base_url!}/source/images/rotating-ball-o.svg); } #banner_wave_1 { - background: url(${res_base_url!}/source/images/wave1.png) repeat-x; + background-image: url(${res_base_url!}/source/images/wave1.png) repeat-x; } #banner_wave_2 { - background: url(${res_base_url!}/source/images/wave2.png) repeat-x; + background-image: url(${res_base_url!}/source/images/wave2.png) repeat-x; } <#if (settings.cursor_skin!'sakura') == 'sakura'> /** 鼠标样式 */ diff --git a/index.ftl b/index.ftl index 7da4635..1e98317 100644 --- a/index.ftl +++ b/index.ftl @@ -44,24 +44,7 @@ <@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3"> - <#if (settings.pagenav_style!'ajax') == 'ajax'> - - <#else> - - + <#include "layouts/list-nextprev.ftl"> diff --git a/journals.ftl b/journals.ftl index 5ebf82b..8e79c3f 100644 --- a/journals.ftl +++ b/journals.ftl @@ -10,13 +10,21 @@
-

${options.journals_title?default('日志')}

+ <#if options.journals_title?default("")?trim?length gt 1> +

${options.journals_title}

+ <#else> +

+
<#else>
-

${options.journals_title?default('日志')}

+ <#if options.journals_title?default("")?trim?length gt 1> +

${options.journals_title}

+ <#else> +

+