Explorar el Código

```
feat(i18n): 实现课程卡片和学习系统页面的国际化

- 将course-card.vue中的"查看详情"和"开始使用"替换为国际化标签
- 在en.js和zh-CN.js中添加新的国际化词条,包括学习阶段、教程分类、技能标签等
- 在LearningSystem.vue中将静态文本替换为国际化标签
- 添加最小宽度和白空间样式以防止文本换行
```

zhangningning hace 1 mes
padre
commit
627ef527a8

+ 2 - 2
src/components/course-card.vue

@@ -30,11 +30,11 @@
       <div class="gap10 mt16 button-container">
         <el-button type="primary" class="flex_1" size="large" plain @click.stop.prevent="goWorkflowDetail">
           <el-icon class="mr10"><Document /></el-icon>
-          查看详情
+          {{$t('common.viewDetails')}}
         </el-button>
         <el-button type="primary" class="flex_1 gradient" size="large">
           <el-icon class="mr10"><VideoPlay /></el-icon>
-          开始使用
+          {{$t('common.startUsing')}}
         </el-button>
       </div>
     </div>

+ 16 - 1
src/locales/en.js

@@ -69,7 +69,20 @@ export default {
     agree: 'Agree',
     reject: 'Reject',
     viewHomepage: 'View Homepage',
-    empty:'No data available'
+    empty:'No data available',
+    all: 'All',
+    studyStage: 'Study Stage',
+    courseCategory: 'Course Category',
+    skillTag: 'Skill Tag',
+    dictType: 'Type',
+    dictTypeSecond: 'Second Type',
+    go: 'Go ',
+    platform: 'Platform',
+    demandStatus: 'Demand Status',
+    publishTime: 'Publish Time',
+    startUsing: 'Start Using',
+    total: 'Total',
+    demandCount: 'Demand Count',
   },
   login: {
     smsLogin: 'SMS Login',
@@ -104,6 +117,8 @@ export default {
     signUpSuccess: 'Sign Up Success',
     signUpFailed: 'Sign Up Failed, please try again later',
     publishSuccess: 'Publish Success',
+    demandStatusSignUping: 'Sign Uping',
+    demandStatusEnded: 'Ended',
   },
   personalCenter:{
     personalCenter: 'Personal Center',

+ 17 - 1
src/locales/zh-CN.js

@@ -1,3 +1,4 @@
+import { all } from "axios";
 import PersonalCenter from "../pages/PersonalCenter.vue";
 
 export default {
@@ -72,7 +73,20 @@ export default {
     agree: '同意',
     reject: '拒绝',
     viewHomepage: '查看主页',
-    empty:'暂无数据'
+    empty:'暂无数据',
+    all: '全部',
+    studyStage: '学习阶段',
+    courseCategory: '教程分类',
+    skillTag: '技能标签',
+    dictType: '类型',
+    dictTypeSecond: '二级分类',
+    go: '前往',
+    platform: '平台',
+    demandStatus: '需求状态',
+    publishTime: '发布时间',
+    startUsing: '开始使用',
+    total: '共',
+    demandCount: '条需求',
   },
   login: {
     smsLogin: '短信登录',
@@ -106,6 +120,8 @@ export default {
     signUpSuccess: '报名成功',
     signUpFailed: '报名失败,请稍后重试',
     publishSuccess: '发布成功',
+    demandStatusSignUping: '报名中',
+    demandStatusEnded: '已结束',
   },
   personalCenter:{
     personalCenter: '个人中心',

+ 8 - 7
src/pages/LearningSystem/LearningSystem.vue

@@ -25,12 +25,12 @@
       <Breadcrumb />
       <div class="padding12 bg_color_fff border_radius_16 box_shadow_card">
         <div class="typeList flex-between typeborder">
-          <div class="gray font_size14 typeName">学习阶段:</div>
+          <div class="gray font_size14 typeName">{{$t('common.studyStage')}}:</div>
           <div class="flex_1 gap10">
             <div class="font_size14 typeItem"  :class="{'active':searchFom.studyStage === ''}"
             @click="searchFom.studyStage = '';getList('init');"
             :key="-1">
-              全部
+              {{$t('common.all')}}
             </div>
             <div class="font_size14 typeItem" 
              v-for="item in bus_study_stage" :key="item.dictValue"
@@ -41,12 +41,12 @@
           </div>
         </div>
         <div class="typeList flex-between typeborder">
-          <div class="gray font_size14 typeName">教程分类:</div>
+          <div class="gray font_size14 typeName">{{$t('common.courseCategory')}}:</div>
           <div class="flex_1 gap10">
             <div class="font_size14 typeItem"  :class="{'active':searchFom.courseCategory === ''}"
             @click="searchFom.courseCategory = '';getList('init');"
             :key="-1">
-              全部
+              {{$t('common.all')}}
             </div>
             <div class="font_size14 typeItem" 
              v-for="item in bus_course_category" :key="item.dictValue"
@@ -57,12 +57,12 @@
           </div>
         </div>
         <div class="typeList flex-between">
-          <div class="gray font_size14 typeName">技能标签:</div>
+          <div class="gray font_size14 typeName">{{$t('common.skillTag')}}:</div>
           <div class="flex_1 gap10">
             <div class="font_size14 typeItem"  :class="{'active':searchFom.skillTag === ''}"
             @click="searchFom.skillTag = ''; getList('init');"
             :key="-1">
-              全部
+              {{$t('common.all')}}
             </div>
             <div class="font_size14 typeItem" 
              v-for="item in bus_skill_tag" :key="item.dictValue"
@@ -249,7 +249,8 @@
     }
     .typeName{
       margin-top: 6px;
-      width: 80px;
+      min-width: 80px;
+      white-space: nowrap;
     }
     .typeItem{
       margin: 0 8px;

+ 7 - 6
src/pages/SearchPlatform.vue

@@ -23,17 +23,17 @@
           </button>
           <div class="flex-center-between border_radius_10 pad20" style="background: #EAF0FF;height: 56px;">
             <img :src="n8Icon" alt="" style="width: 30px; height: 30px;" class="mr10">
-            <div class="font_size18 color_theme">前往{{activePlatform}}</div>
+            <div class="font_size18 color_theme">{{$t('common.go')}}{{activePlatform}}</div>
             <el-icon :size="24" color="#2D71FF"><CaretRight /></el-icon>
           </div>
         </div>
         <div class="typeList flex-between typeborder">
-          <div class="gray font_size14 typeName">类型:</div>
+          <div class="gray font_size14 typeName">{{$t('common.dictType')}}:</div>
           <div class="flex_1 gap10">
             <div class="font_size14 typeItem"  :class="{'active':searchFom.categoryId2 === ''}"
             @click="searchFom.categoryId2 = ''; searchFom.categoryId3 = '';getList('init');categoryListTree2=[]"
             :key="-1">
-              全部
+              {{$t('common.all')}}
             </div>
             <div class="font_size14 typeItem" 
              v-for="item in categoryListTree" :key="item.categoryId"
@@ -44,12 +44,12 @@
           </div>
         </div>
         <div class="typeList flex-between">
-          <div class="gray font_size14 typeName">二级分类:</div>
+          <div class="gray font_size14 typeName">{{$t('common.dictTypeSecond')}}:</div>
           <div class="flex_1 gap10">
             <div class="font_size14 typeItem"  :class="{'active':searchFom.categoryId3 === ''}"
             @click="searchFom.categoryId3 = ''; getList('init');"
             :key="-1">
-              全部
+              {{$t('common.all')}}
             </div>
             <div class="font_size14 typeItem" 
              v-for="item in categoryListTree2" :key="item.categoryId"
@@ -241,7 +241,8 @@
     }
     .typeName{
       margin-top: 6px;
-      width: 80px;
+      min-width: 80px;
+      white-space: nowrap;
     }
     .typeItem{
       margin: 0 8px;

+ 20 - 13
src/pages/workflowTrade/workflowTrade.vue

@@ -23,12 +23,12 @@
           </button>
         </div>
         <div class="typeList flex-between typeborder">
-          <div class="gray font_size14 typeName">平台:</div>
+          <div class="gray font_size14 typeName">{{$t('common.platform')}}:</div>
           <div class="flex_1 gap10"> 
             <div class="font_size14 typeItem"  :class="{'active':searchFom.categoryId1 === ''}"
             @click="searchFom.categoryId1 = ''; getList('init');"
             :key="-1">
-              全部
+              {{$t('common.all')}}
             </div>
             <div class="font_size14 typeItem"  :class="{'active':item.categoryId === searchFom.categoryId1}"
             @click="searchFom.categoryId1 = item.categoryId; getList('init');"
@@ -38,22 +38,24 @@
           </div>
         </div>
         <div class="typeList flex-between typeborder">
-          <div class="gray font_size14 typeName">需求状态:</div>
+          <div class="gray font_size14 typeName">{{$t('common.demandStatus')}}:</div>
           <div class="flex_1 gap10">
             <div class="font_size14 typeItem" 
              :class="{'active':searchFom.applyStatus == ''}"
              @click="searchFom.applyStatus = ''; getList('init');"
-             :key="-1">全部</div>
+             :key="-1">
+              {{$t('common.all')}}
+            </div>
             <div class="font_size14 typeItem"
              :class="{'active':key === searchFom.applyStatus}"
              @click="searchFom.applyStatus = key; getList('init');"
-             v-for="(value,key) in applyStatusInfo" :key="key">
+             v-for="(value,key) in {'1': $t('workflowTrade.demandStatusSignUping'), '2': $t('workflowTrade.demandStatusEnded')}" :key="key">
               {{value}}
             </div>
           </div>
         </div>
         <div class="typeList flex-between">
-          <div class="gray font_size14 typeName">发布时间:</div>
+          <div class="gray font_size14 typeName">{{$t('common.publishTime')}}:</div>
           <div class="flex_1">
             <div style="width: 320px">
               <el-date-picker
@@ -72,14 +74,18 @@
       </div>
       <!-- 列表 -->
       <div class="course-list mt20">
-        <div class="font_size20 bold mb10">共 <span class="color_theme">{{listTotal}}</span> 条需求</div>
+        <div class="font_size20 bold mb10">
+          {{$t('common.total')}} <span class="color_theme">{{listTotal}}</span> {{$t('common.demandCount')}}
+        </div>
         <div class="padding16 bg_color_fff border_radius_16 mb20 box_shadow_card list_item_animation" 
           v-for="item in list" :key="item.questId"
         >
           <div  @click="goworkflowTradeDetail(item)" class="cursor-pointer">
             <div class="flex-between">
               <div class="gap10">
-                <el-button type="primary" v-if="applyStatusInfo[item.applyStatus]">{{applyStatusInfo[item.applyStatus]}}</el-button>
+                <el-button type="primary" v-if="applyStatusInfo[item.applyStatus]">
+                  {{item.applyStatus === '1' ? $t('workflowTrade.demandStatusSignUping') : $t('workflowTrade.demandStatusEnded')}}
+                </el-button>
                 <div class="bold font_size30">{{item.title}}</div>
               </div>
               <div class="font_size24 color_price bold">¥{{item.budgetMin}}-{{item.budgetMax}}</div>
@@ -90,11 +96,11 @@
               <el-button type="primary" size="large" plain>{{item.categoryName3}}</el-button>
               <div class="gap5">
                 <img :src="yuangong" alt="" style="width: 16px; height: 16px;">
-                <span class="font_size14">{{item.questCount || 0}} 人报名</span>
+                <span class="font_size14">{{item.questCount || 0}} {{$t('common.renbaoming')}}</span>
               </div>
               <div class="gap5">
                 <img :src="riliIcon" alt="" style="width: 16px; height: 16px;">
-                <span class="font_size14">报名截止时间:{{item.deadline}}</span>
+                <span class="font_size14">{{$t('common.signUpDeadline')}}:{{item.deadline}}</span>
               </div>
             </div>
             <div class="font_size16 gray mt10">{{item.requirements || ''}}</div>
@@ -162,8 +168,8 @@
     return route.matched.length > 1
   });
   const applyStatusInfo = {
-    '1': '报名中',
-    '2': '已结束',
+    '1': t('workflowTrade.demandStatusSignUping'),
+    '2': t('workflowTrade.demandStatusEnded'),
   }
   // 一级分类列表
   const CategoryList = ref([]);
@@ -302,7 +308,8 @@
     }
     .typeName{
       margin-top: 6px;
-      width: 80px;
+      min-width: 80px;
+      white-space: nowrap;
     }
     .typeItem{
       margin: 0 8px;