diff --git a/app/index/lang/en-us.php b/app/index/lang/en-us.php index 70edf02..fd27a80 100644 --- a/app/index/lang/en-us.php +++ b/app/index/lang/en-us.php @@ -2,33 +2,60 @@ return [ //menu - 'index' => 'index', - 'home_page' => 'home page', - 'user_center' => 'center', - 'set_info' => 'set info', - 'my_message' => 'message', - 'my_page' => 'my page', + 'index' => 'Index', + 'home page' => 'Home page', + 'user center' => 'Center', + 'set info' => 'Set info', + 'my message' => 'Message', + 'my page' => 'My page', - 'login' => 'login', - 'logout' => 'logout', - 'register' => 'register', - 'discuss' => 'discuss', - 'case' => 'case', - 'timeline' => 'timeline', + 'login' => 'Login', + 'logout' => 'Logout', + 'register' => 'Register', + 'discuss' => 'Discuss', + 'case' => 'Case', + 'timeline' => 'Timeline', //帖子 - 'add_post' => 'add post', - 'my_collection' => 'my collection', - 'all' => 'all', - 'over' => 'over', - 'hot' => 'hot', - 'top' => 'top', - 'go_sign' => 'go sign', - 'more_post' => 'more post', - 'friendly_link' => 'friendly link', + 'title color' => 'Title color', + 'add_post' => 'Add post', + 'my collection' => 'My collection', + 'cancel collection' => 'cancel collection', + 'all' => 'All', + 'finished' => 'Finished', + 'no finished' => 'no finished', + 'hot' => 'Hot', + 'top' => 'Top', + 'cancel hoting' => 'Cancel hoting', + 'cancel topping' => 'Cancel topping', + 'go sign' => 'Go sign', + 'more post' => 'more post', + 'friendly link' => 'Friendly link', + 'reviewers list' => 'Reviewers list', + 'hot post list' => 'Hot post list', + 'links list' => 'Links list', + 'Sign in' => 'Sign in', + 'statement' => 'Statement', + 'trends' => 'Trends', + 'sponsor' => 'Sponsor sponsor', + 'i want to join' => 'i want to join', + 'official products' => 'Official products', + 'no comments' => 'No comments', + 'submit comments' => 'Submit comments', + 'reply' => 'reply', + 'accept' => 'accept', + 'please input the content' => 'please input the content', + 'ads area' => 'Ads area', + 'enclosure' => 'enclosure', + 'download files' => 'Download files', + + //message + 'add' => 'add', + 'delete' => 'delete', + 'edit' => 'edit', 'add success' => 'add success!', 'add error' => 'add error', 'edit success' => 'articel edit success', diff --git a/app/index/lang/zh-cn.php b/app/index/lang/zh-cn.php index 223ee36..885ad0c 100644 --- a/app/index/lang/zh-cn.php +++ b/app/index/lang/zh-cn.php @@ -3,11 +3,11 @@ return [ //menu 'index' => 'index', - 'home_page' => '首页', - 'user_center' => '用户中心', - 'set_info' => '设置', - 'my_message' => '我的消息', - 'my_page' => '我的主页', + 'home page' => '首页', + 'user center' => '用户中心', + 'set info' => '设置', + 'my message' => '我的消息', + 'my page' => '我的主页', 'login' => '登录', 'logout' => '退出', @@ -17,21 +17,41 @@ return [ 'timeline' => '框架日志', //帖子 + 'title color' => '颜色', 'add_post' => '添加帖子', - 'my_collection' => '我的收藏', + 'my collection' => '我的收藏', + 'cancel collection' => '取消收藏', 'all' => '综合', - 'over' => '已结', + 'finished' => '已结', + 'no finished' => '未结', 'hot' => '热贴', 'top' => '精贴', - 'go_sign' => '去签到', - 'more_post' => '更多帖子', - 'friendly_link' => '友情链接', - - + 'cancel hoting' => '取消精贴', + 'cancel topping' => '取消置顶', + 'go sign' => '去签到', + 'more post' => '更多帖子', + 'friendly link' => '友情链接', + 'reviewers list' => '回帖热榜', + 'hot post list' => '本周热议', + 'links list' => '温馨通道', + 'Sign in' => '签到', + 'statement' => '说明', + 'trends' => '动态', + 'sponsor' => '钻级赞助商', + 'i want to join' => '我要加入', + 'official products' => '官方产品', + 'no comments' => '暂时还没有评论', + 'submit comments' => '提交评论', + 'reply' => '回复', + 'accept' => '采纳', + 'please input the content' => '请输入内容', + 'ads area' => '广告区', + 'enclosure' => '附件', + 'download files' => '下载文件', - 'hello thinkphp' => '欢迎使用ThinkPHP', - 'data type error' => '数据类型错误', + 'add' => '添加', + 'delete' => '删除', 'add success' => '添加成功!', 'add error' => '添加失败', 'edit success' => '修改成功', diff --git a/app/index/middleware.php b/app/index/middleware.php index 2918e68..10b6a9b 100644 --- a/app/index/middleware.php +++ b/app/index/middleware.php @@ -4,6 +4,8 @@ return [ \app\middleware\LoginCookie::class, \app\middleware\Install::class, \app\middleware\Browse::class, + // 多语言加载 + \think\middleware\LoadLangPack::class, //app\middleware\LoginCheck::class, //app\middleware\CheckRegister::class, //'logedcheck' => \app\middleware\logedCheck::class, diff --git a/public/static/res/mods/index.js b/public/static/res/mods/index.js index 56d45b8..197a6e7 100644 --- a/public/static/res/mods/index.js +++ b/public/static/res/mods/index.js @@ -850,12 +850,23 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util'], function( } }); }); + + + //监听语音选择提交 + form.on('select(language)', function(data){ + var data = data.value; + $.post(langUrl,{language:data},function(result){ + location.reload(); + }); + return false; + }); //固定Bar util.fixbar({ bar1: '' ,bgcolor: '#009688' ,click: function(type){ + //添加文章 if(type === 'bar1'){ //slayer.msg('打开 index.js,开启发表新帖的路径'); location.href = articleAdd; diff --git a/view/taoler/index/article/cate.html b/view/taoler/index/article/cate.html index 7095ba1..1587283 100644 --- a/view/taoler/index/article/cate.html +++ b/view/taoler/index/article/cate.html @@ -35,14 +35,14 @@ {$art.create_time|date='Y-m-d'} {$art.pv} - {if ($art.jie == 1)}已结{/if} + {if ($art.jie == 1)}{:lang('finished')}{/if} {$art.comments_count}
- {if ($art.is_top == 1)} 置顶 {/if} - {if ($art.is_hot == 1)} 精帖 {/if} + {if ($art.is_top == 1)} {:lang('top')} {/if} + {if ($art.is_hot == 1)} {:lang('hot')} {/if}
{/volist} @@ -54,7 +54,7 @@
-
本周热议
+
{:lang('hot post list')}
{volist name="artHot" id="vo"}
{$vo.title} @@ -64,8 +64,8 @@
-
心级赞助商 - - 我要加入 +
{:lang('sponsor')}- + {:lang('i want to join')}
{volist name="ad_cate" id="vo"} diff --git a/view/taoler/index/article/detail.html b/view/taoler/index/article/detail.html index ce6b295..0109f17 100644 --- a/view/taoler/index/article/detail.html +++ b/view/taoler/index/article/detail.html @@ -16,35 +16,35 @@ {$article.cate.catename} {if ($article.jie == 0)} - 未结 + {:lang('no finished')} {else /} - 已结 + {:lang('finished')} {/if} {if ($article.is_top == 1)} - 置顶 + {:lang('top')} {/if} {if ($article.is_hot == 1)} - 精帖 + {:lang('hot')} {/if}
{if ($user.auth ?? '')} - 删除 + {:lang('delete')} {if($article.is_top == 0)} - 置顶 + {:lang('top')} {else /} - 取消置顶 + {:lang('cancel topping')} {/if} {if($article.is_hot == 0)} - 加精 + {:lang('hot')} {else /} - 取消加精 + {:lang('cancel hoting')} {/if} - 高亮 + {:lang('title color')} {/if}
- {$comments->count()} + {$comments->count()} {$pv}
@@ -66,26 +66,26 @@
{if(session('user_name')==$article.user.name || ($user.auth ?? ''))} - 编辑此贴 + {:lang('edit')} {/if}
{$article.content|raw}
{notempty name="$article.upzip"}
- - + +
{/notempty}
- 回帖 + {:lang('reply')}
-
本周热议
+
{:lang('hot post list')}
{volist name="artHot" id="vo"}
{$vo.title} @@ -181,8 +181,8 @@
-
心级赞助商 - - 我要加入 +
{:lang('sponsor')}- + {:lang('i want to join')}
{volist name="ad_art" id="vo"} @@ -192,9 +192,7 @@
-
- 这里可作为广告区域 -
+
{:lang('ads area')}
TaoLer 社区快速轻论坛 diff --git a/view/taoler/index/index/index.html b/view/taoler/index/index/index.html index 2b0e3b0..4010798 100644 --- a/view/taoler/index/index/index.html +++ b/view/taoler/index/index/index.html @@ -18,7 +18,7 @@
    {volist name="artTop" id="top" empty="还没有推荐"} @@ -36,7 +36,7 @@
@@ -44,14 +44,14 @@
-

温馨通道

+

{:lang('links list')}

{include file="public/index-static" /}
{include file="public/sign" /}
-
钻级赞助商 - 我要加入 +
{:lang('sponsor')} + {:lang('i want to join')}
{volist name="ad_index" id="vo"} @@ -61,14 +61,14 @@
-

回贴周榜

+

{:lang('reviewers list')}

-
本周热议
+
{:lang('hot post list')}
{volist name="artHot" id="vo"}
{$vo.title} @@ -78,9 +78,7 @@
-
- 官方产品 -
+
{:lang('official products')}
@@ -211,16 +209,6 @@ }); }); - //监听语音选择提交 - form.on('select(language)', function(data){ - var data = data.value; - console.log(data); - $.post("{:url('index/select')}",{language:data},function(result){ - - }); - return false; - }); - }); $('#friend-link').on('click', function(){ diff --git a/view/taoler/index/public/filter.html b/view/taoler/index/public/filter.html index dc1eaf9..ce4dfd5 100644 --- a/view/taoler/index/public/filter.html +++ b/view/taoler/index/public/filter.html @@ -1,7 +1,7 @@
{:lang('all')} - {:lang('over')} + {:lang('finished')} {:lang('top')} diff --git a/view/taoler/index/public/flink.html b/view/taoler/index/public/flink.html index f26c8b9..0d0b7e8 100644 --- a/view/taoler/index/public/flink.html +++ b/view/taoler/index/public/flink.html @@ -1,5 +1,5 @@