mirror of https://github.com/vtrois/kratos
fix: multilingual display (#319)
parent
01f3b1fb22
commit
ee16e36245
|
@ -1 +1 @@
|
|||
jQuery(document).ready(function(e){var t=e("#cancel-comment-reply-link"),n=t.text(),o="list";e(document).on("submit","#commentform",function(){return e.ajax({url:ajaxcomment.ajax_url,data:e(this).serialize()+"&action=ajax_comment",type:e(this).attr("method"),beforeSend:function(){layer.msg("评论正在提交中")},error:function(e){layer.msg(e.responseText)},success:function(t){e("textarea").each(function(){this.value=""});var n=addComment,r=n.I("cancel-comment-reply-link"),m=n.I("wp-temp-form-div"),a=n.I(n.respondId),c=(n.I("comment_post_ID").value,n.I("comment_parent").value);"0"!=c?e("#comment-"+c).append('<ul class="children">'+t+"</ul>"):"asc"==ajaxcomment.order?e("."+o).append(t):e("."+o).prepend(t),layer.msg("评论提交成功"),r.style.display="none",r.onclick=null,n.I("comment_parent").value="0",m&&a&&(m.parentNode.insertBefore(a,m),m.parentNode.removeChild(m))}}),!1}),addComment={moveForm:function(o,r,m){var a,c=this,l=c.I(o),p=c.I(m),d=c.I("cancel-comment-reply-link"),i=c.I("comment_parent");c.I("comment_post_ID");t.text(n),c.respondId=m,c.I("wp-temp-form-div")||(a=document.createElement("div"),a.id="wp-temp-form-div",a.style.display="none",p.parentNode.insertBefore(a,p)),l?l.parentNode.insertBefore(p,l.nextSibling):(temp=c.I("wp-temp-form-div"),c.I("comment_parent").value="0",temp.parentNode.insertBefore(p,temp),temp.parentNode.removeChild(temp)),e("body").animate({scrollTop:e("#respond").offset().top-150},400),i.value=r,d.style.display="",d.onclick=function(){var e=addComment,t=e.I("wp-temp-form-div"),n=e.I(e.respondId);return e.I("comment_parent").value="0",t&&n&&(t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)),this.style.display="none",this.onclick=null,!1};try{c.I("comment").focus()}catch(e){}return!1},I:function(e){return document.getElementById(e)},createButterbar:function(e){layer.msg(e)}}});
|
||||
jQuery(document).ready(function(e){var t=e("#cancel-comment-reply-link"),n=t.text(),o="list";e(document).on("submit","#commentform",function(){return e.ajax({url:ajaxcomment.ajax_url,data:e(this).serialize()+"&action=ajax_comment",type:e(this).attr("method"),beforeSend:function(){layer.msg(ajaxcomment.compost)},error:function(e){layer.msg(e.responseText)},success:function(t){e("textarea").each(function(){this.value=""});var n=addComment,r=n.I("cancel-comment-reply-link"),m=n.I("wp-temp-form-div"),a=n.I(n.respondId),c=(n.I("comment_post_ID").value,n.I("comment_parent").value);"0"!=c?e("#comment-"+c).append('<ul class="children">'+t+"</ul>"):"asc"==ajaxcomment.order?e("."+o).append(t):e("."+o).prepend(t),layer.msg(ajaxcomment.comsucc),r.style.display="none",r.onclick=null,n.I("comment_parent").value="0",m&&a&&(m.parentNode.insertBefore(a,m),m.parentNode.removeChild(m))}}),!1}),addComment={moveForm:function(o,r,m){var a,c=this,l=c.I(o),p=c.I(m),d=c.I("cancel-comment-reply-link"),i=c.I("comment_parent");c.I("comment_post_ID");t.text(n),c.respondId=m,c.I("wp-temp-form-div")||(a=document.createElement("div"),a.id="wp-temp-form-div",a.style.display="none",p.parentNode.insertBefore(a,p)),l?l.parentNode.insertBefore(p,l.nextSibling):(temp=c.I("wp-temp-form-div"),c.I("comment_parent").value="0",temp.parentNode.insertBefore(p,temp),temp.parentNode.removeChild(temp)),e("body").animate({scrollTop:e("#respond").offset().top-150},400),i.value=r,d.style.display="",d.onclick=function(){var e=addComment,t=e.I("wp-temp-form-div"),n=e.I(e.respondId);return e.I("comment_parent").value="0",t&&n&&(t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)),this.style.display="none",this.onclick=null,!1};try{c.I("comment").focus()}catch(e){}return!1},I:function(e){return document.getElementById(e)},createButterbar:function(e){layer.msg(e)}}});
|
|
@ -3,7 +3,7 @@
|
|||
* 文章相关函数
|
||||
* @author Seaton Jiang <seaton@vtrois.com>
|
||||
* @license MIT License
|
||||
* @version 2020.12.02
|
||||
* @version 2021.01.06
|
||||
*/
|
||||
|
||||
// 文章链接添加 target 和 rel
|
||||
|
@ -206,7 +206,9 @@ function comment_scripts()
|
|||
wp_enqueue_script('comment', ASSET_PATH . '/assets/js/comments.min.js', array(), THEME_VERSION);
|
||||
wp_localize_script('comment', 'ajaxcomment', array(
|
||||
'ajax_url' => admin_url('admin-ajax.php'),
|
||||
'order' => get_option('comment_order')
|
||||
'order' => get_option('comment_order'),
|
||||
'compost' => __('评论正在提交中','kratos'),
|
||||
'comsucc' => __('评论提交成功','kratos'),
|
||||
));
|
||||
}
|
||||
add_action('wp_enqueue_scripts', 'comment_scripts');
|
||||
|
@ -244,7 +246,7 @@ function comment_callback()
|
|||
<?php comment_text();?>
|
||||
</div>
|
||||
<div class="meta clearfix">
|
||||
<div class="date d-inline-block float-left"><?php echo get_comment_date('Y年m月d日'); ?><?php if (current_user_can('edit_posts')) {echo '<span class="ml-2">';edit_comment_link(__('编辑', 'kratos'));echo '</span>';};?>
|
||||
<div class="date d-inline-block float-left"><?php echo get_comment_date(); ?><?php if (current_user_can('edit_posts')) {echo '<span class="ml-2">';edit_comment_link(__('编辑', 'kratos'));echo '</span>';};?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -283,7 +285,7 @@ function comment_callbacks($comment, $args, $depth = 2)
|
|||
<?php comment_text();?>
|
||||
</div>
|
||||
<div class="meta clearfix">
|
||||
<div class="date d-inline-block float-left"><?php echo get_comment_date('Y年m月d日'); ?><?php if (current_user_can('edit_posts')) {echo '<span class="ml-2">';edit_comment_link(__('编辑', 'kratos'));echo '</span>';};?>
|
||||
<div class="date d-inline-block float-left"><?php echo get_comment_date(); ?><?php if (current_user_can('edit_posts')) {echo '<span class="ml-2">';edit_comment_link(__('编辑', 'kratos'));echo '</span>';};?>
|
||||
</div>
|
||||
<div class="tool reply ml-2 d-inline-block float-right">
|
||||
<?php
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* 侧栏小工具
|
||||
* @author Seaton Jiang <seaton@vtrois.com>
|
||||
* @license MIT License
|
||||
* @version 2020.12.14
|
||||
* @version 2020.12.17
|
||||
*/
|
||||
|
||||
// 添加小工具
|
||||
|
@ -66,15 +66,15 @@ function timeago($ptime){
|
|||
$ptime = strtotime($ptime);
|
||||
$etime = time() - $ptime;
|
||||
if($etime < 1)
|
||||
return'刚刚';
|
||||
return '刚刚';
|
||||
$interval = array(
|
||||
12*30*24*60*60 => ' 年前('.date('m月d日',$ptime).')',
|
||||
30*24*60*60 => ' 个月前('.date('m月d日',$ptime).')',
|
||||
7*24*60*60 => ' 周前('.date('m月d日',$ptime).')',
|
||||
24*60*60 => ' 天前('.date('m月d日',$ptime).')',
|
||||
60*60 => ' 小时前('.date('m月d日',$ptime).')',
|
||||
60 => ' 分钟前('.date('m月d日',$ptime).')',
|
||||
1 => ' 秒前('.date('m月d日',$ptime).')',
|
||||
12*30*24*60*60 => __(' 年前','kratos').'('.date(__('m月d日','kratos'),$ptime).')',
|
||||
30*24*60*60 => __(' 个月前','kratos').'('.date(__('m月d日','kratos'),$ptime).')',
|
||||
7*24*60*60 => __(' 周前','kratos').'('.date(__('m月d日','kratos'),$ptime).')',
|
||||
24*60*60 => __(' 天前','kratos').'('.date(__('m月d日','kratos'),$ptime).')',
|
||||
60*60 => __(' 小时前','kratos').'('.date(__('m月d日','kratos'),$ptime).')',
|
||||
60 => __(' 分钟前','kratos').'('.date(__('m月d日','kratos'),$ptime).')',
|
||||
1 => __(' 秒前','kratos').'('.date(__('m月d日','kratos'),$ptime).')',
|
||||
);
|
||||
foreach($interval as$secs=>$str){
|
||||
$d=$etime/$secs;
|
||||
|
@ -466,7 +466,7 @@ class widget_comments extends WP_Widget
|
|||
public function widget($args, $instance)
|
||||
{
|
||||
$number = !empty($instance['number']) ? $instance['number'] : '5';
|
||||
$title = !empty($instance['title']) ? $instance['title'] : '最近评论';
|
||||
$title = !empty($instance['title']) ? $instance['title'] : __('最近评论', 'kratos');
|
||||
|
||||
echo '<div class="widget w-comments"><div class="title">'. $title .'</div><div class="comments">';
|
||||
echo latest_comments($number, 50);
|
||||
|
@ -486,7 +486,7 @@ class widget_comments extends WP_Widget
|
|||
{
|
||||
global $wpdb;
|
||||
$number = !empty($instance['number']) ? $instance['number'] : '5';
|
||||
$title = !empty($instance['title']) ? $instance['title'] : '最近评论';
|
||||
$title = !empty($instance['title']) ? $instance['title'] : __('最近评论', 'kratos');
|
||||
?>
|
||||
<div class="media-widget-control">
|
||||
<p>
|
||||
|
|
|
@ -3,7 +3,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||
"Project-Id-Version: Kratos\n"
|
||||
"POT-Creation-Date: 2020-12-14 15:09+0800\n"
|
||||
"POT-Creation-Date: 2021-01-06 10:03+0800\n"
|
||||
"PO-Revision-Date: 2020-02-14 23:32+0800\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
|
@ -217,43 +217,51 @@ msgstr ""
|
|||
msgid "浏览文件"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-article.php:247 inc/theme-article.php:286
|
||||
#: inc/theme-article.php:210
|
||||
msgid "评论正在提交中"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-article.php:211
|
||||
msgid "评论提交成功"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-article.php:249 inc/theme-article.php:288
|
||||
msgid "编辑"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-article.php:290 inc/theme-smtp.php:102
|
||||
#: inc/theme-article.php:292 inc/theme-smtp.php:102
|
||||
msgid "回复"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-article.php:345
|
||||
#: inc/theme-article.php:347
|
||||
msgid "添加表情"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-article.php:398
|
||||
#: inc/theme-article.php:400
|
||||
msgid "描述"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-article.php:403 inc/theme-options.php:226
|
||||
#: inc/theme-article.php:405 inc/theme-options.php:226
|
||||
msgid "关键词"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-article.php:409
|
||||
#: inc/theme-article.php:411
|
||||
msgid "SEO 设置"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-core.php:80
|
||||
#: inc/theme-core.php:84
|
||||
msgid "您已经赞过了"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-core.php:81
|
||||
#: inc/theme-core.php:85
|
||||
msgid "感谢您的支持"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-core.php:82
|
||||
#: inc/theme-core.php:86
|
||||
msgid "打赏作者"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-core.php:83
|
||||
#: inc/theme-core.php:87
|
||||
msgid "扫码支付"
|
||||
msgstr ""
|
||||
|
||||
|
@ -968,6 +976,40 @@ msgstr ""
|
|||
msgid "侧边栏工具"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:71
|
||||
msgid " 年前"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:71 inc/theme-widgets.php:72 inc/theme-widgets.php:73
|
||||
#: inc/theme-widgets.php:74 inc/theme-widgets.php:75 inc/theme-widgets.php:76
|
||||
#: inc/theme-widgets.php:77
|
||||
msgid "m月d日"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:72
|
||||
msgid " 个月前"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:73
|
||||
msgid " 周前"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:74
|
||||
msgid " 天前"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:75
|
||||
msgid " 小时前"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:76
|
||||
msgid " 分钟前"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:77
|
||||
msgid " 秒前"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:115
|
||||
msgid "发布于 "
|
||||
msgstr ""
|
||||
|
@ -1089,7 +1131,8 @@ msgstr ""
|
|||
msgid "默认显示:"
|
||||
msgstr ""
|
||||
|
||||
#: inc/theme-widgets.php:459
|
||||
#: inc/theme-widgets.php:459 inc/theme-widgets.php:469
|
||||
#: inc/theme-widgets.php:489
|
||||
msgid "最近评论"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* 文章列表
|
||||
* @author Seaton Jiang <seaton@vtrois.com>
|
||||
* @license MIT License
|
||||
* @version 2020.12.14
|
||||
* @version 2021.01.06
|
||||
*/
|
||||
?>
|
||||
<div class="article-panel">
|
||||
|
@ -39,7 +39,7 @@
|
|||
</div>
|
||||
<div class="a-meta">
|
||||
<span class="float-left d-none d-md-block">
|
||||
<span class="mr-2"><i class="kicon i-calendar"></i><?php echo get_the_date('Y年m月d日'); ?></span>
|
||||
<span class="mr-2"><i class="kicon i-calendar"></i><?php echo get_the_date(); ?></span>
|
||||
<span class="mr-2"><i class="kicon i-comments"></i><?php comments_number('0', '1', '%'); _e('条评论', 'kratos'); ?></span>
|
||||
</span>
|
||||
<span class="float-left d-block">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* 文章内容
|
||||
* @author Seaton Jiang <seaton@vtrois.com>
|
||||
* @license MIT License
|
||||
* @version 2020.06.08
|
||||
* @version 2021.01.06
|
||||
*/
|
||||
|
||||
get_header();
|
||||
|
@ -48,7 +48,7 @@ $select_col = $col_array[kratos_option('g_article_widgets', 'two_side')];
|
|||
<div class="header">
|
||||
<h1 class="title"><?php the_title(); ?></h1>
|
||||
<div class="meta">
|
||||
<span><?php echo get_the_date('Y年m月d日'); ?></span>
|
||||
<span><?php echo get_the_date(); ?></span>
|
||||
<span ><?php echo get_post_views(); _e('点热度' , 'kratos'); ?></span>
|
||||
<span><?php if (get_post_meta($post->ID, 'love', true)) { echo get_post_meta($post->ID, 'love', true); } else {echo '0'; } _e('人点赞', 'kratos'); ?></span>
|
||||
<span><?php comments_number('0', '1', '%'); _e('条评论', 'kratos'); ?></span>
|
||||
|
@ -125,8 +125,8 @@ $select_col = $col_array[kratos_option('g_article_widgets', 'two_side')];
|
|||
<?php if ( get_the_tags() ) { the_tags('', ' ', ''); } else{ echo '<a>' . __( '暂无' , 'kratos') . '</a>'; }?>
|
||||
</div>
|
||||
<div class="tool float-right d-none d-lg-block">
|
||||
<div data-toggle="tooltip" data-html="true" data-original-title="<?php _e('最后更新:','kratos'); the_modified_date( 'Y-m-d H:i' ) ?>">
|
||||
<span><?php _e('最后更新:','kratos'); ?><?php the_modified_date('Y年m月d日'); ?></span>
|
||||
<div data-toggle="tooltip" data-html="true" data-original-title="<?php _e('最后更新:','kratos'); the_modified_date() ?>">
|
||||
<span><?php _e('最后更新:','kratos'); ?><?php the_modified_date(); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue