diff --git a/app/api/controller/Article.php b/app/api/controller/Article.php index 99ec61486..70ccbab3b 100644 --- a/app/api/controller/Article.php +++ b/app/api/controller/Article.php @@ -145,10 +145,10 @@ class Article extends Common ]; $ret = SystemBaseService::DataReturn($result); } else { - $ret = DataReturn('文章不存在或已删除', -1); + $ret = DataReturn(MyLang('article.article_no_data_tips'), -1); } } else { - $ret = DataReturn('文章ID有误', -1); + $ret = DataReturn(MyLang('article.article_id_params_tips'), -1); } return ApiService::ApiDataReturn($ret); } diff --git a/app/api/controller/Common.php b/app/api/controller/Common.php index 1524bf6b7..2bfad5c6d 100755 --- a/app/api/controller/Common.php +++ b/app/api/controller/Common.php @@ -130,7 +130,7 @@ class Common extends BaseController { if(MyC('home_site_state') != 1) { - exit(json_encode(DataReturn(MyC('home_site_close_reason', '升级中...'), -10000))); + exit(json_encode(DataReturn(MyC('home_site_close_reason', MyLang('upgrading_tips')), -10000))); } } @@ -228,7 +228,7 @@ class Common extends BaseController { if(!empty($this->user) && !empty($this->data_request['token']) && $this->data_request['token'] != ApiService::CreatedUserToken($this->user['id'])) { - exit(json_encode(DataReturn('token非法', -1000))); + exit(json_encode(DataReturn(MyLang('token_error_tips'), -1000))); } } @@ -244,7 +244,7 @@ class Common extends BaseController */ public function __call($method, $args) { - return ApiService::ApiDataReturn(DataReturn($method.' 非法访问', -1000)); + return ApiService::ApiDataReturn(DataReturn(MyLang('illegal_access_tips').'('.$method.')', -1000)); } } ?> \ No newline at end of file diff --git a/app/api/controller/Error.php b/app/api/controller/Error.php index 5a4eaccd8..cf2291021 100644 --- a/app/api/controller/Error.php +++ b/app/api/controller/Error.php @@ -34,7 +34,7 @@ class Error extends Common */ public function __call($method, $args) { - return ApiService::ApiDataReturn(DataReturn(RequestController().' 控制器不存在', -1000)); + return ApiService::ApiDataReturn(DataReturn(MyLang('controller_not_exist_tips').'('.RequestController().')', -1000)); } } ?> \ No newline at end of file diff --git a/app/api/controller/Order.php b/app/api/controller/Order.php index 28b32ab32..969c7b9ee 100755 --- a/app/api/controller/Order.php +++ b/app/api/controller/Order.php @@ -44,7 +44,7 @@ class Order extends Common } /** - * [Index 获取订单列表] + * 获取订单列表 * @author Devil * @blog http://gong.gg/ * @version 0.0.1 @@ -174,14 +174,14 @@ class Order extends Common // 是否已评论 if($data['data'][0]['user_is_comments'] > 0) { - $ret = DataReturn('你已进行过评论', -100); + $ret = DataReturn(MyLang('order.form_you_have_commented_tips'), -100); } else { // 返回数据 $result = [ 'data' => $data['data'][0], 'editor_path_type' => ResourcesService::EditorPathTypeValue('order_comments-'.$this->user['id'].'-'.$data['data'][0]['id']), ]; - $ret = DataReturn('你已进行过评论', 0, $result); + $ret = DataReturn(MyLang('order.form_you_have_commented_tips'), 0, $result); } } else { $ret = DataReturn(MyLang('no_data'), -100); diff --git a/app/api/controller/Plugins.php b/app/api/controller/Plugins.php index 6501a4eec..6f4f19c38 100644 --- a/app/api/controller/Plugins.php +++ b/app/api/controller/Plugins.php @@ -53,17 +53,17 @@ class Plugins extends Common [ 'checked_type' => 'empty', 'key_name' => 'pluginsname', - 'error_msg' => '应用名称有误', + 'error_msg' => MyLang('plugins_name_tips'), ], [ 'checked_type' => 'empty', 'key_name' => 'pluginscontrol', - 'error_msg' => '应用控制器有误', + 'error_msg' => MyLang('plugins_control_tips'), ], [ 'checked_type' => 'empty', 'key_name' => 'pluginsaction', - 'error_msg' => '应用操作方法有误', + 'error_msg' => MyLang('plugins_action_tips'), ], ]; $ret = ParamsChecked($params['data_request'], $p); diff --git a/app/api/lang/en.php b/app/api/lang/en.php new file mode 100644 index 000000000..ff98b0f38 --- /dev/null +++ b/app/api/lang/en.php @@ -0,0 +1,32 @@ + 'Illegal token', + // 文章 + 'article' => [ + 'article_no_data_tips' => 'Article does not exist or has been deleted', + 'article_id_params_tips' => 'Incorrect article ID', + ], + // 订单管理 + 'order' => [ + 'form_you_have_commented_tips' => 'You have already commented', + ], +]; +?> \ No newline at end of file diff --git a/app/api/lang/index.html b/app/api/lang/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/app/api/lang/zh.php b/app/api/lang/zh.php new file mode 100644 index 000000000..0ca49aa32 --- /dev/null +++ b/app/api/lang/zh.php @@ -0,0 +1,32 @@ + 'token非法', + // 文章 + 'article' => [ + 'article_no_data_tips' => '文章不存在或已删除', + 'article_id_params_tips' => '文章ID有误', + ], + // 订单管理 + 'order' => [ + 'form_you_have_commented_tips' => '你已进行过评论', + ], +]; +?> \ No newline at end of file