gemercheung hace 2 años
padre
commit
e4503a867f

+ 6 - 7
src/components/chatRoom/index.vue

@@ -13,7 +13,7 @@
       <div class="saySomething" @click="onFocus" :class="{ disabled: !inputStatus }">
         <!-- <i class="speakIcon"
            :class="{'dis':!user_info.IsWords}"></i> -->
-        <span v-if="inputStatus">说点什么~</span>
+        <span v-if="inputStatus">{{ t('base.saySomething') }}</span>
         <span v-else>已被禁言</span>
 
         <div
@@ -62,11 +62,11 @@
             type="text"
             maxlength="50"
             v-model.trim="text"
-            :placeholder="`说点什么~`"
+            :placeholder="t('base.saySomething')"
           />
-          <span class="iconsend_icon" :class="{ disable: text == '' }" @click.stop="sendText"
-            >发送</span
-          >
+          <span class="iconsend_icon" :class="{ disable: text == '' }" @click.stop="sendText">{{
+            t('base.send')
+          }}</span>
         </div>
       </div>
     </div>
@@ -108,7 +108,6 @@
     @confirm-dialog="handleCloseRoom"
   />
   <CreatedName :show="showCreateNameDialog" @confirm-dialog="handleNameConfirm" />
-  <BaseDialog />
 </template>
 
 <script lang="ts" setup>
@@ -140,7 +139,7 @@
   import CloseDialog from './dialog/close.vue';
   import ShareContainer from './share.vue';
   import CreatedName from './dialog/createdName.vue';
-  import BaseDialog from './dialog/base.vue';
+
   import { useAppStore } from '/@/store/modules/app';
   import { useI18n } from '/@/hooks/useI18n';
   // hook

+ 3 - 2
src/components/chatRoom/memberList.vue

@@ -4,7 +4,7 @@
       <div class="blurBox"></div>
       <div class="content">
         <div class="memberHeader">
-          <span> 成员管理({{ data?.length }})</span>
+          <span> {{ t('base.memberManager') }} ({{ data?.length }})</span>
           <i class="iconfont"></i>
         </div>
         <div class="memberList">
@@ -60,9 +60,10 @@
   import defaultAvatar from '/@/assets/images/rtcLive/avatar_small@2x.png';
   import { computed, watchEffect } from 'vue';
   import { useSocket } from '/@/hooks/userSocket';
+  import { useI18n } from '/@/hooks/useI18n';
   // import Dialog from '../basic/dialog';
   const rtcStore = useRtcStore();
-
+  const { t } = useI18n();
   const role = computed(() => rtcStore.role);
   const isNativeLeader = computed(() => rtcStore.isLeader);
 

+ 10 - 4
src/components/chatRoom/share.vue

@@ -11,14 +11,15 @@
         </div>
 
         <div class="created_btn">
-          <div class="created_cancel" @click="closeCreated">取消</div>
+          <div class="created_cancel" @click="closeCreated">{{ t('base.cancel') }}</div>
           <div
             class="created_confirm"
             ref="copylink$"
             :data-clipboard-text="shareLink"
             @click="createdConfirm"
           >
-            复制分享
+            <!-- 复制分享 -->
+            {{ t('base.copyShare') }}
           </div>
         </div>
       </div>
@@ -30,13 +31,18 @@
   import { onMounted, defineProps, defineEmits, ref, unref, watchEffect } from 'vue';
   import ClipboardJS from 'clipboard';
   import Dialog from '/@/components/basic/dialog';
+  import { useI18n } from '/@/hooks/useI18n';
+  const { t } = useI18n();
 
   const emit = defineEmits(['close']);
 
   const props = defineProps({
     title: {
       type: String,
-      default: '邀请好友',
+      default: () => {
+        const { t } = useI18n();
+        return t('base.inviteFriends');
+      },
     },
     shareLink: {
       type: String,
@@ -55,7 +61,7 @@
       const ele = unref(copylink$) as any as HTMLElement;
       new ClipboardJS(ele).on('success', function (e) {
         e.clearSelection();
-        Dialog.toast({ content: '链接复制成功', type: 'success' });
+        Dialog.toast({ content: t('base.copyShareSuccess'), type: 'success' });
         setTimeout(() => {
           show.value = false;
           emit('close');

+ 4 - 1
src/locales/lang/en/base.ts

@@ -8,6 +8,8 @@ export default {
   sceneList: 'Scene List',
   inviteFriends: 'Invite Friends',
   copy: 'copy',
+  copyShare: 'copy share Link',
+  copyShareSuccess: 'The link Successfully copied',
   share: 'share',
   cancel: 'cancel',
   tips: 'tips',
@@ -19,6 +21,7 @@ export default {
   floorPlanView: 'Floor plan/ Dollhouse',
   copySuccess: 'Successfully copied',
   errorRoom: 'Abnormal studio, please contact the host.',
-  knowIt: 'Confirm',
+  knowIt: 'Confirm',
   view: 'view',
+  send: 'Send',
 };

+ 3 - 0
src/locales/lang/zh/base.ts

@@ -10,6 +10,8 @@ export default {
   copy: '复制',
   confirm: '确定',
   share: '分享',
+  copyShare: '复制分享',
+  copyShareSuccess: '链接复制成功',
   cancel: '取消',
   tips: '温馨提示',
   maxRooms: '带看人数已满,可切换自由观看。',
@@ -22,4 +24,5 @@ export default {
   errorRoom: '房间异常,请联系主持人。',
   knowIt: '我知道了。',
   view: '观看',
+  send: '发送',
 };

+ 5 - 5
src/settings/localeSetting.ts

@@ -1,17 +1,17 @@
 import type { LocaleSetting, LocaleType } from '/#/config';
 
 export const LOCALE: { [key: string]: LocaleType } = {
-  ZH_CN: 'zh_CN',
-  EN_US: 'en',
+  ZH: 'zh',
+  EN: 'en',
 };
 
 export const localeSetting: LocaleSetting = {
   // Locale
-  locale: LOCALE.ZH_CN,
+  locale: LOCALE.ZH,
   // Default locale
-  fallback: LOCALE.ZH_CN,
+  fallback: LOCALE.ZH,
   // available Locales
-  availableLocales: [LOCALE.ZH_CN, LOCALE.EN_US],
+  availableLocales: [LOCALE.ZH, LOCALE.EN],
 };
 
 // locale list