Browse Source

1783 文章评论管理翻译

kevin_zhangl 3 years ago
parent
commit
ae042b7362

+ 2 - 2
backendApi/config/menu.php

@@ -358,11 +358,11 @@ return [
         'routePath'=>'article',
         'show'=>1,
         'child'=>[
-            ['name'=>'分类管理', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category', 'routePath'=>'article/category', 'show'=>1,],
+            ['name'=>'Category Management', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category', 'routePath'=>'article/category', 'show'=>1,],//分类管理
             ['name'=>'添加分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-add', 'routePath'=>'article/category-add', 'show'=>0,],
             ['name'=>'删除分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-delete', 'routePath'=>'article/category-delete', 'show'=>0,],
             ['name'=>'分类排序', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-sort', 'routePath'=>'article/category-sort', 'show'=>0,],
-            ['name'=>'文章列表', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'index', 'routePath'=>'article/index', 'show'=>1,],
+            ['name'=>'Article Management', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'index', 'routePath'=>'article/index', 'show'=>1,],//文章列表
             ['name'=>'添加文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'add', 'routePath'=>'article/add', 'show'=>0,],
             ['name'=>'编辑文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'edit', 'routePath'=>'article/edit', 'show'=>0,],
             ['name'=>'删除文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'article-delete', 'routePath'=>'article/article-delete', 'show'=>0,],

+ 5 - 5
backendApi/modules/v1/controllers/ArticleController.php

@@ -41,7 +41,7 @@ class ArticleController extends BaseController
      */
     public function actionCategoryAdd(){
         if(Yii::$app->request->isPost) {
-            return parent::edit(ArticleCategoryForm::class, '文章分类添加成功');
+            return parent::edit(ArticleCategoryForm::class, 'Successful');
         }
     }
 
@@ -66,9 +66,9 @@ class ArticleController extends BaseController
             $formModel = new ArticleCategoryForm();
             $formModel->scenario = 'sort';
             if($formModel->load(Yii::$app->request->get(), '') && $formModel->sortTo()){
-                return static::notice('排序成功');
+                return static::notice('Successful');
             } else {
-                return static::notice('排序失败', 400);
+                return static::notice('Fail', 400);
             }
         }
     }
@@ -95,7 +95,7 @@ class ArticleController extends BaseController
      */
     public function actionAdd(){
         if(Yii::$app->request->isPost) {
-            return parent::edit(ArticleForm::class, '文章添加成功');
+            return parent::edit(ArticleForm::class, 'Successful');
         }
         // 获取全部分类
         $allCategory = ArticleCategory::find()->where('STATUS=1')->asArray()->all();
@@ -111,7 +111,7 @@ class ArticleController extends BaseController
     public function actionEdit(){
         $id = Yii::$app->request->get('id');
         if(Yii::$app->request->isPost){
-            return parent::edit(ArticleForm::class, '编辑成功');
+            return parent::edit(ArticleForm::class, 'Successful');
         }
         $oneData = Article::findOneAsArray(['ID'=>$id]);
         $oneData['CONTENT'] = is_resource($oneData['CONTENT']) ? stream_get_contents($oneData['CONTENT']) : '';

+ 4 - 4
backendApi/modules/v1/controllers/BaseController.php

@@ -142,7 +142,7 @@ class BaseController extends \yii\rest\ActiveController {
             $selected = \Yii::$app->request->post('selected');
         }
         if (!$selected) {
-            return self::notice('必须选择一条删除数据', 500);
+            return self::notice('must select one item to delete', 500);// 必须选择一条删除数据
         }
 
         // 是否存在 DONT_DEL 字段
@@ -178,7 +178,7 @@ class BaseController extends \yii\rest\ActiveController {
             if ($isDelData) {
                 // 真实删除数据
                 if (!$modelClass::deleteAll($condition, $params)) {
-                    throw new Exception('删除失败');
+                    throw new Exception('failed to delete');//删除失败
                 }
             } else {
                 // 设置IS_DEL字段为1
@@ -186,7 +186,7 @@ class BaseController extends \yii\rest\ActiveController {
             }
             if ($afterFun) $afterFun($selected);
             $transaction->commit();
-            return self::notice('删除成功');
+            return self::notice('delete successfully');//删除成功
         } catch (Exception $e) {
             $transaction->rollBack();
             return self::notice($e->getMessage(), 500);
@@ -272,7 +272,7 @@ class BaseController extends \yii\rest\ActiveController {
                 reset($getValueArr);
                 if($filterModel == 'date'){
                     if( $getSymbol !== '>=' && $getSymbol !== '<=' && $getSymbol !== '>' && $getSymbol !== '<' ) {
-                        throw new \Exception("日期筛选格式不对");
+                        throw new \Exception("Incorrect date format");//日期筛选格式不对
                     }
                     $bindValue = strtotime($getValueArr[1]);
                     $isDate = true;

+ 13 - 13
backendEle/src/router/index.js

@@ -1397,10 +1397,10 @@ export const constantRouterMap = [
         component: _import('article/category'),
         name: 'article_category',
         meta: {
-          title: '分类管理',
+          title: 'Category Management',//分类管理
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: '分类管理', path: '/article/category'},
+            {title: 'Category Management', path: '/article/category'},
           ],
         },
       },
@@ -1409,12 +1409,12 @@ export const constantRouterMap = [
         component: _import('article/category-add'),
         name: 'article_category-add',
         meta: {
-          title: '添加分类',
+          title: 'New category',
           highLight: '/article/category-add',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: '分类管理', path: '/article/category'},
-            {title: '添加分类', path: '/article/category-add'},
+            {title: 'Category Management', path: '/article/category'},
+            {title: 'New category', path: '/article/category-add'},//添加分类
           ],
         },
       },
@@ -1423,10 +1423,10 @@ export const constantRouterMap = [
         component: _import('article/index'),
         name: 'article_index',
         meta: {
-          title: '文章列表',
+          title: 'Article Management',//文章列表
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: '文章列表', path: '/article/index'},
+            {title: 'Article Management', path: '/article/index'},
           ],
         },
       },
@@ -1435,12 +1435,12 @@ export const constantRouterMap = [
         component: _import('article/edit'),
         name: 'article_add',
         meta: {
-          title: '添加文章',
+          title: 'New category',
           highLight: '/article/index',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: '文章列表', path: '/article/index'},
-            {title: '添加文章', path: '/article/add'},
+            {title: 'Article Management', path: '/article/index'},
+            {title: 'New category', path: '/article/add'},
           ],
         },
       },
@@ -1449,12 +1449,12 @@ export const constantRouterMap = [
         component: _import('article/edit'),
         name: 'article_edit',
         meta: {
-          title: '编辑文章',
+          title: 'Edit category',
           highLight: '/article/index',
           breadcrumb: [
             {title: 'Dashboard', path: '/dashboard/index'},
-            {title: '文章列表', path: '/article/index'},
-            {title: '编辑文章', path: '/article/edit'},
+            {title: 'Article Management', path: '/article/index'},
+            {title: 'Edit category', path: '/article/edit'},
           ],
         },
       },

+ 3 - 3
backendEle/src/utils/editor.js

@@ -3,14 +3,14 @@ import {CDN_IMG_URL} from './config'
 const EDITOR_ROOT_URL = `${CDN_IMG_URL}/tinymce`
 const EDITOR_LANGUAGE = `${EDITOR_ROOT_URL}/langs/zh_CN.js`
 let fullEditor = {
-  language_url: EDITOR_LANGUAGE,
+  // language_url: EDITOR_LANGUAGE,
   height: 500,
   plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen link template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount imagetools contextmenu colorpicker textpattern help',
   toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify  | numlist bullist outdent indent  | removeformat',
 }
 
 let textEditor = {
-  language_url: EDITOR_LANGUAGE,
+  // language_url: EDITOR_LANGUAGE,
   height: 500,
   menubar: false,
   plugins: [
@@ -25,4 +25,4 @@ export {
   fullEditor,
   textEditor,
   EDITOR_ROOT_URL
-}
+}

+ 3 - 3
backendEle/src/views/article/category-add.vue

@@ -1,12 +1,12 @@
 <template>
   <div v-loading="loading">
     <div class="white-box">
-      <el-form ref="form" :model="form" label-width="100px" style="width:500px;">
-        <el-form-item label="分类名称">
+      <el-form ref="form" :model="form" label-width="150px" style="width:500px;">
+        <el-form-item label="Category name"><!--分类名称-->
           <el-input v-model="form.cateName"></el-input>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" :loading="submitButtonStat" @click="onSubmit">Submit<!-- 提交 --></el-button>
+          <el-button type="primary" :loading="submitButtonStat" @click="onSubmit">Confirm<!-- 提交 --></el-button>
         </el-form-item>
       </el-form>
     </div>

+ 6 - 6
backendEle/src/views/article/category.vue

@@ -3,19 +3,19 @@
     <div class="white-box">
       <el-table :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55"></el-table-column>
-        <el-table-column label="分类名称" prop="CATE_NAME"></el-table-column>
-        <el-table-column label="排序" width="100">
+        <el-table-column label="Category name" prop="CATE_NAME"></el-table-column><!--分类名称-->
+        <el-table-column label="Order" width="100"><!--排序-->
           <template slot-scope="scope">
             <el-input v-model="scope.row.SORT" min="0" max="99"
                       @change="handleChangeSort(scope.row, scope.row.SORT)"></el-input>
           </template>
         </el-table-column>
-        <el-table-column label="创建时间">
+        <el-table-column label="Creation time"><!--创建时间-->
           <template slot-scope="scope">
             {{tool.formatDate(scope.row.CREATED_AT)}}
           </template>
         </el-table-column>
-        <el-table-column fixed="right" label="操作" width="180">
+        <el-table-column fixed="right" label="Action" width="180"><!--操作-->
           <template slot-scope="scope">
             <el-dropdown size="small" trigger="click">
               <el-button type="primary" size="small" @click.stop="">
@@ -37,7 +37,7 @@
             <el-dropdown-item command="delete" @click.native="handleMuliDel()">Delete</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
-        <el-button type="primary" size="small" @click="handleAdd">新建分类</el-button>
+        <el-button type="primary" size="small" @click="handleAdd">New category</el-button><!--新建分类-->
         <el-pagination
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
@@ -106,7 +106,7 @@ export default {
     },
     delData (id = null) {
       let obj = this
-      obj.$confirm('确定删除选定的数据?', 'Notice', {
+      obj.$confirm('Are you sure to delete the selected data?', 'Hint', {//确定删除选定的数据
         confirmButtonText: 'confirm', // 确定
         cancelButtonText: 'cancel', // 取消
         type: 'warning'

+ 5 - 5
backendEle/src/views/article/edit.vue

@@ -2,20 +2,20 @@
   <div v-loading="loading">
     <div class="white-box">
       <el-form ref="form" :model="form" label-width="100px" style="">
-        <el-form-item label="标题" style="width: 500px;">
+        <el-form-item label="Title" style="width: 500px;"><!--标题-->
           <el-input v-model="form.title"></el-input>
         </el-form-item>
-        <el-form-item label="分类">
-          <el-select v-model="form.cid" placeholder="请选择分类">
+        <el-form-item label="Category"><!--分类-->
+          <el-select v-model="form.cid" placeholder="please select category"><!--请选择分类-->
             <el-option v-for="item in allCategory" :label="item.CATE_NAME" :value="item.ID" :key="item.ID"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="内容">
+        <el-form-item label="Content"><!--内容-->
           <editor id="contentEditor" :cloud-channel="editorRootUrl" ref="contentEditor" v-model="form.content"
                   :init="editorOptions"></editor>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" :loading="submitButtonStat" @click="onSubmit">Submit<!-- 提交 --></el-button>
+          <el-button type="primary" :loading="submitButtonStat" @click="onSubmit">Confirm<!-- 提交 --></el-button>
         </el-form-item>
       </el-form>
     </div>

+ 6 - 6
backendEle/src/views/article/index.vue

@@ -3,18 +3,18 @@
     <div class="white-box">
       <el-table :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55"></el-table-column>
-        <el-table-column label="标题" prop="TITLE"></el-table-column>
-        <el-table-column label="分类">
+        <el-table-column label="Title" prop="TITLE"></el-table-column><!--标题-->
+        <el-table-column label="Category"><!--分类-->
           <template slot-scope="scope">
             {{allData.allCategory[scope.row.CID].CATE_NAME}}
           </template>
         </el-table-column>
-        <el-table-column label="创建时间">
+        <el-table-column label="Creation time"><!--创建时间-->
           <template slot-scope="scope">
             {{tool.formatDate(scope.row.CREATED_AT)}}
           </template>
         </el-table-column>
-        <el-table-column fixed="right" label="操作" width="180">
+        <el-table-column fixed="right" label="Action" width="180"><!--操作-->
           <template slot-scope="scope">
             <el-dropdown size="small" trigger="click">
               <el-button type="primary" size="small" @click.stop="">
@@ -37,7 +37,7 @@
             <el-dropdown-item command="delete" @click.native="handleMuliDel()">Delete</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
-        <el-button type="primary" size="small" @click="handleAdd">添加文章</el-button>
+        <el-button type="primary" size="small" @click="handleAdd">New article</el-button><!--添加文章-->
         <el-pagination
           @size-change="handleSizeChange"
           @current-change="handleCurrentChange"
@@ -106,7 +106,7 @@ export default {
     },
     delData (id = null) {
       let obj = this
-      obj.$confirm('确定删除选定的数据?', 'Notice', {
+      obj.$confirm('Are you sure to delete the selected data?', 'Hint', {// 确定删除选定的数据
         confirmButtonText: 'confirm', // 确定
         cancelButtonText: 'cancel', // 取消
         type: 'warning'

+ 6 - 6
backendEle/src/views/shop/goods-add.vue

@@ -148,12 +148,12 @@
                 }
             },
             // 监听商品标准价格,自动计算销售价格
-            'form.sellPriceStandard': {
-                deep: true,
-                handler(modern, origin) {
-                    this.form.sellPrice = modern * this.exchangeRate
-                }
-            },
+            // 'form.sellPriceStandard': {
+            //     deep: true,
+            //     handler(modern, origin) {
+            //         this.form.sellPrice = modern * this.exchangeRate
+            //     }
+            // },
         },
         methods: {
             handleRemove(file) {

+ 7 - 7
backendEle/src/views/shop/index.vue

@@ -438,13 +438,13 @@
                     this.pvDisabled = (parseInt(modern) === 1)
                 }
             },
-            // 监听商品标准价格,自动计算销售价格
-            'form.sellPriceStandard': {
-                deep: true,
-                handler(modern, origin) {
-                    this.form.sellPrice = modern * this.exchangeRate
-                }
-            },
+            // // 监听商品标准价格,自动计算销售价格
+            // 'form.sellPriceStandard': {
+            //     deep: true,
+            //     handler(modern, origin) {
+            //         this.form.sellPrice = modern * this.exchangeRate
+            //     }
+            // },
         },
     }