Browse Source

feat(国际化): 添加新的翻译字段并优化导航菜单

- 在中文和英文语言文件中新增多个翻译字段
- 将导航菜单中的硬编码文本替换为国际化字段
- 修复下拉菜单的样式问题
ext.zhangbin71 2 weeks ago
parent
commit
d78228b8d4
3 changed files with 22 additions and 6 deletions
  1. 6 6
      src/App.vue
  2. 8 0
      src/locales/en.js
  3. 8 0
      src/locales/zh-CN.js

+ 6 - 6
src/App.vue

@@ -63,7 +63,7 @@
                       <span v-if="isActive(item.path)" class="absolute bottom-0 left-3 right-3 h-0.5 bg-gradient-to-r from-blue-500 to-purple-500 rounded-full"></span>
                     </button>
                     <!-- 下拉子菜单 -->
-                    <div class="absolute top-full left-1/2 -translate-x-1/2 pt-2 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 translate-y-1 group-hover:translate-y-0">
+                    <div class="absolute top-full left-1/2 -translate-x-1/2 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 translate-y-1 group-hover:translate-y-0">
                       <div class="bg-white rounded-2xl shadow-xl shadow-slate-200/60 border border-slate-100 p-2 min-w-[200px]">
                         <!-- 小三角 -->
                         <div class="absolute -top-1.5 left-1/2 -translate-x-1/2 w-3 h-3 bg-white border-l border-t border-slate-100 rotate-45"></div>
@@ -192,7 +192,7 @@
                     ref="searchInputRef"
                     v-model="searchQuery"
                     type="text"
-                    placeholder="搜索工作流、教程、功能..."
+                    :placeholder="$t('common.search_placeholder')"
                     class="w-full pl-11 pr-12 py-2.5 text-sm bg-slate-50 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition-all"
                     @keyup.enter="doSearch"
                     @keyup.escape="searchOpen = false"
@@ -392,8 +392,8 @@ const navigation = ref([
     href: '#',
     path: '/',
     children: [
-      { path: '/', icon: '🔍', label: '工作流搜索', desc: '搜索 10,000+ 工作流模板' },
-      { path: '/workflow-trade', icon: '💼', label: '工作流交易', desc: '发布或承接定制需求' },
+      { path: '/', icon: '🔍', label: t('common.gongzuoliu_search'), desc: t('common.gongzuoliu_search_desc') },
+      { path: '/workflow-trade', icon: '💼', label: t('common.gongzuoliu_trade'), desc: t('common.gongzuoliu_trade_desc') },
     ]
   },
   { name: 'common.gongzuoliu_trade', href: '#', path: '/workflow-trade' },
@@ -402,8 +402,8 @@ const navigation = ref([
     href: '#',
     path: '/learning-system',
     children: [
-      { path: '/learning-system', icon: '🎓', label: '学习教程', desc: '系统化 AI 工作流课程' },
-      { path: '/learn-note', icon: '📝', label: '学习笔记', desc: '记录你的学习心得' },
+      { path: '/learning-system', icon: '🎓', label: t('common.learning_course'), desc: t('common.learning_course_desc') },
+      { path: '/learn-note', icon: '📝', label: t('common.learning_note'), desc: t('common.learning_note_desc') },
     ]
   },
   { name: 'common.xuxibiji', href: '#', path: '/learn-note' },

+ 8 - 0
src/locales/en.js

@@ -6,10 +6,18 @@ export default {
     login: 'Login',
     qingshuruyaosousuodegongzuoliu: 'Please input the workflow to search',
     shousuo: 'Search',
+    search_placeholder: 'Search workflows, courses, features...',
     chuangjiangongzuoliu: 'Create Workflow',
     fabuxuqiu: 'Publish Demand',
     gongzuoliu: 'Workflow',
     gongzuoliu_trade: 'Workflow Trade',
+    gongzuoliu_search: 'Workflow Search',
+    gongzuoliu_search_desc: 'Search 10,000+ workflow templates',
+    gongzuoliu_trade_desc: 'Publish or undertake custom needs',
+    learning_course: 'Learning Course',
+    learning_course_desc: 'Systematic AI workflow courses',
+    learning_note: 'Learning Notes',
+    learning_note_desc: 'Record your learning insights',
     zaixianbaoming: 'Online Registration',
     mibi: 'MiBi',
     baomibi: 'BoomBi',

+ 8 - 0
src/locales/zh-CN.js

@@ -11,10 +11,18 @@ export default {
     login: '登录',
     qingshuruyaosousuodegongzuoliu: '请输入要搜索的工作流',
     shousuo: '搜索',
+    search_placeholder: '搜索工作流、教程、功能...',
     chuangjiangongzuoliu: '创建工作流',
     fabuxuqiu: '发布需求',
     gongzuoliu: '工作流',
     gongzuoliu_trade: '工作流交易',
+    gongzuoliu_search: '工作流搜索',
+    gongzuoliu_search_desc: '搜索 10,000+ 工作流模板',
+    gongzuoliu_trade_desc: '发布或承接定制需求',
+    learning_course: '学习教程',
+    learning_course_desc: '系统化 AI 工作流课程',
+    learning_note: '学习笔记',
+    learning_note_desc: '记录你的学习心得',
     zaixianbaoming: '在线报名',
     mibi: '米币',
     baomibi: '暴米币',