Ver código fonte

feat: 完善多语言硬编码

Jack Zhou 1 semana atrás
pai
commit
d879a60127

+ 2 - 2
src/components/ContainerStatus/src/ContainerStatus.vue

@@ -51,7 +51,7 @@ watch(
       >
         <template #title>
           <div class="title">
-            {{ t('containerStatus.container') }} <span>{{ containers.label }}</span>
+            {{ t('common.container') }} <span>{{ containers.label }}</span>
           </div>
         </template>
         <div class="step-item" v-for="(item, index) in containers.content" :key="item.title">
@@ -74,7 +74,7 @@ watch(
       <div class="empty-text" style="">{{ t('common.noData') }}</div>
     </div>
     <div class="footer" v-if="props.website && userStore.userInfo?.user_type === 'employee'">
-      {{ t('containerStatus.trackingOnCarrierWebsite') }}
+      {{ t('common.trackingOnCarrierWebsite') }}:
       <a :href="props.website" target="_blank" class="link">{{ props.website }}</a>
     </div>
   </div>

+ 1 - 1
src/components/NotificationMessageCard/src/components/EventCard.vue

@@ -141,7 +141,7 @@ const jumpTracking = (data: EventCardPropsData) => {
         <!-- container类型显示图标 -->
         <div v-else>
           <span class="font_family icon-icon_container__filled_b"></span>
-          <span class="no">{{ t('containerStatus.container') }}: {{ data.no }}</span>
+          <span class="no">{{ t('common.container') }}: {{ data.no }}</span>
         </div>
         <div class="tag" :class="{ delay: data.type === 'delay', change: data.type === 'change' }">
           <span class="dot"></span>

+ 1 - 1
src/components/ShipmentStatus/src/ShipmentStatus.vue

@@ -163,7 +163,7 @@ const { isOverflow: isPathOverflow } = useOverflow(pathRef, props)
               </div>
               <div class="bottom">
                 <span class="font_family icon-icon_container_b"></span>
-                <div style="margin-top: 1px; margin-left: 4px">{{ t('containerStatus.container') }}:</div>
+                <div style="margin-top: 1px; margin-left: 4px">{{ t('common.container') }}:</div>
                 <div style="margin-left: 4px; margin-top: 3px; font-weight: 700">
                   {{ deliveredItem.container }}
                 </div>

+ 5 - 1
src/components/VBox/src/VBox.vue

@@ -72,7 +72,11 @@ const vBoxPopoverRef = ref()
               :key="item.name"
             >
               <span class="font_family" :class="[`icon-${item.icon}`]"></span>
-              <span>{{ t(`vbox.${item.id === 1 ? 'moveToTop' : item.id === 2 ? 'moveUp' : item.id === 3 ? 'moveDown' : 'moveToBottom'}`) }}</span>
+              <span>{{
+                t(
+                  `common.${item.id === 1 ? 'moveToTop' : item.id === 2 ? 'moveUp' : item.id === 3 ? 'moveDown' : 'moveToBottom'}`
+                )
+              }}</span>
             </div>
           </div>
           <template #reference v-if="props.isDraggable">

+ 86 - 21
src/locales/en.json

@@ -92,6 +92,9 @@
     "logout": "Logout",
     "light": "Light",
     "dark": "Dark",
+    "edit": "Edit",
+    "copy": "Copy",
+    "delete": "Delete",
     "clearFilters": "Clear Filters",
     "downloadFile": "Download File",
     "selectedColumns": "Selected columns",
@@ -175,15 +178,17 @@
     "emptyResultLine1": "We didn't find any search results,",
     "emptyResultLine2": "please try to adjust your search keywords.",
     "pageGuide": "Page Guide",
-    "created": "Created",
-    "modified": "Modified",
-    "pending": "Pending",
-    "confirmed": "Confirmed",
-    "cancelled": "Cancelled",
+
     "departed": "Departed",
     "cargoReceived": "Cargo Received",
     "arrived": "Arrived",
-    "completed": "Completed"
+    "completed": "Completed",
+    "moveToTop": "Move to Top",
+    "moveUp": "Move Up",
+    "moveDown": "Move Down",
+    "moveToBottom": "Move to Bottom",
+    "container": "Container",
+    "trackingOnCarrierWebsite": "Tracking on carrier website"
   },
   "tracking": {
     "title": "Tracking",
@@ -428,11 +433,35 @@
     "emailRecipients": "Email Recipients",
     "timezone": "Timezone",
     "deliveryFrequency": "Delivery Frequency",
-    "time": "Time",
-    "week": "Week",
+    "daily": "Daily",
+    "weekly": "Weekly",
     "monthly": "Monthly",
     "quarterly": "Quarterly",
     "yearly": "Yearly",
+    "monday": "Monday",
+    "tuesday": "Tuesday",
+    "wednesday": "Wednesday",
+    "thursday": "Thursday",
+    "friday": "Friday",
+    "saturday": "Saturday",
+    "sunday": "Sunday",
+    "january": "January",
+    "february": "February",
+    "march": "March",
+    "april": "April",
+    "may": "May",
+    "june": "June",
+    "july": "July",
+    "august": "August",
+    "september": "September",
+    "october": "October",
+    "november": "November",
+    "december": "December",
+    "firstMonth": "1st Month",
+    "secondMonth": "2nd Month",
+    "thirdMonth": "3rd Month",
+    "time": "Time",
+    "week": "Week",
     "day": "Day",
     "month": "Month",
     "quarter": "Quarter",
@@ -461,13 +490,50 @@
     "applicationScopePlaceholder": "Application Scope",
     "partyIdsPlaceholder": "Party IDs",
     "active": "Active",
+    "activate": "Activate",
     "inactive": "Inactive",
+    "inactivate": "Inactivate",
+    "reportName": "Report Name",
+    "reportLevel": "Report Level",
+    "isActive": "Is Active",
+    "applicationScope": "Application Scope",
+    "creationDate": "Creation Date",
+    "createdBy": "Created By",
+    "modifyBy": "Modify By",
     "allUsers": "All Users",
     "specificUsers": "Specific Users",
+    "specificRolesRequired": "Please select Party ID or Group Name or KLN ONLINE Account for Specific Roles access control.",
+    "saveFailed": "Failed to save Report Template.",
+    "basicReportInformation": "Basic Report Information",
+    "reportAccessControl": "Report Access Control",
+    "allUsersDescription": "This report will be available to all users in the system",
+    "specificRoles": "Specific Roles",
+    "specificRolesDescription": "Restrict access to specific user roles",
+    "partyId": "Party ID",
+    "groupName": "Group Name",
+    "klnOnlineAccount": "KLN ONLINE Account",
+
     "selectPartyIdsMulti": "Select Party IDs (Multi-select allowed)",
     "selectGroupNameMulti": "Select Group Name (Multi-select allowed)",
     "addEditFieldTitle": "Add/Edit Field",
     "searchFieldPlaceholder": "Search field",
+    "selectedFieldsOnReportTemplateList": "Selected fields on report template list",
+    "createNewReportTemplate": "Create New Report Template",
+    "emptyCreateTip": "Click the \"Create New Report Template\" button to add a report template.",
+    "list": "list",
+    "gotIt":"Got it",
+    "booking":"booking",
+    "shipment":"shipment",
+    "drag": "Drag",
+    "dragOperaterTips1": "items to the right group or click the",
+    "dragOperaterTips2": "icon to add columns to the",
+    "removeOperaterTips1": "items to the left group or click the",
+    "removeOperaterTips2": "icon to delete columns from the",
+    "remove": "Remove",
+    "add": "Add",
+    "action": "Action",
+    "dragItemsUpOrDownToReorderThe": "items up or down to reorder the",
+    "orUseTheMoveUpAndMoveDownIcons": "or use the \"Move up\" and \"Move down\" icons.",
     "reportFieldsConfigurationNewFieldNameRequired": "Please enter the new field name.",
     "reportFieldsConfigurationFixedValueRequired": "Please enter the fixed value.",
     "reportFieldsConfigurationReportLevelRequired": "Please select the report level.",
@@ -498,7 +564,11 @@
     "outputValueLabel": "Output Value",
     "addMapping": "Add Mapping",
     "cancel": "Cancel",
-    "apply": "Apply"
+    "apply": "Apply",
+    "dragItemAddOperaterTips": "Drag item over to this selection or click \"add\" icon to show the field on report template list",
+    "containerLevelWillBeCleared": "If the Level value is \"Container Level\", the field will be cleared.",
+    "itemLevelWillBeCleared": "If the Level value is \"Item Level\", the field will be cleared.",
+    "itemOrContainerLevelWillBeCleared": "If the Level value is \"Item Level\" or \"Container Level\", the field will be cleared."
   },
   "aiApiLog": {
     "title": "AI API Log",
@@ -664,17 +734,6 @@
     "maximizedWindowTip": "Maximized Window",
     "collapsedToWidgetTip": "Collapsed to Widget"
   },
-  "containerStatus": {
-    "container": "Container",
-    "trackingOnCarrierWebsite": "Tracking on carrier website:"
-  },
-  
-  "vbox": {
-    "moveToTop": "Move to Top",
-    "moveUp": "Move Up",
-    "moveDown": "Move Down",
-    "moveToBottom": "Move to Bottom"
-  },
   "moreFilters": {
     "vessel": "Vessel",
     "voyageFlight": "Voyage/Flight",
@@ -770,6 +829,7 @@
     "hbolHawb": "HBOL/HAWB",
     "shipper": "Shipper",
     "consignee": "Consignee",
+    "eta": "ETA",
     "etd": "ETD",
     "recentMilestone": "Recent Milestone",
     "createNewRule": "Create New Rule",
@@ -802,7 +862,6 @@
     "numbersUsUk": "1,234.56 (US/UK)",
     "numbersEuropean": "1.234,56 (European)"
   },
- 
   "dashboard": {
     "title": "Dashboard",
     "rememberSaveLayout": "Please remember to click the save button in order to keep the new dashboard layout and widgets.",
@@ -973,6 +1032,12 @@
     "oct": "Oct",
     "nov": "Nov",
     "dec": "Dec",
+    "created": "Created",
+    "modified": "Modified",
+    "pending": "Pending",
+    "confirmed": "Confirmed",
+    "current": "Current",
+
     "deliveryDate": "Delivery Date",
     "deliveryMode": "Delivery Mode",
     "creationDate": "Creation Date",

+ 8 - 8
src/views/DestinationDelivery/src/components/TableView/src/components/BookingDetailDialog.vue

@@ -37,40 +37,40 @@ const stepList: any = ref([])
 
 const handleStepData = (status, data) => {
   stepList.value.push({
-    label: t('common.created'),
+    label: t('destinationDelivery.created'),
     date: data.created_time || '--',
     icon: 'icon_submit_b'
   })
   if (status === 'Modified') {
     stepList.value.push({
-      label: t('common.modified'),
+      label: t('destinationDelivery.modified'),
       date: data.update_time || '--',
       icon: 'icon_edit_b'
     })
   }
   if (status === 'Pending Approval' || status === 'Modified') {
     stepList.value.push({
-      label: t('common.pending'),
-      date: t('common.current'),
+      label: t('destinationDelivery.pending'),
+      date: t('destinationDelivery.current'),
       icon: 'icon_time_b',
       status: 'current'
     })
     stepList.value.push({
-      label: 'Approved',
+      label: t('destinationDelivery.approved'),
       date: '--',
       icon: 'icon_confirm_b',
       status: 'unfinished'
     })
   } else if (status === 'Approved') {
     stepList.value.push({
-      label: 'Approved',
+      label: t('destinationDelivery.approved'),
       date: data.update_time || '--',
       icon: 'icon_confirm_b',
       status: ''
     })
   } else if (status === 'Rejected') {
     stepList.value.push({
-      label: 'Rejected',
+      label: t('destinationDelivery.rejected'),
       date: data.update_time || '--',
       icon: 'icon_reject_b',
       status: 'rejected',
@@ -79,7 +79,7 @@ const handleStepData = (status, data) => {
     })
   } else if (status === 'Cancelled') {
     stepList.value.push({
-      label: 'Cancelled',
+      label: t('destinationDelivery.cancelled'),
       date: data.update_time || '--',
       icon: 'icon_cancelled_b',
       status: 'cancelled'

+ 25 - 25
src/views/Report/src/components/ReportSchedule/src/components/EmailConfiguration.vue

@@ -138,59 +138,59 @@ const timezoneoptions = ref([
 
 const frequencyOptions = ref([
   {
-    label: 'Daily',
+    label: t('report.daily'),
     value: 'daily'
   },
   {
-    label: 'Weekly',
+    label: t('report.weekly'),
     value: 'weekly'
   },
   {
-    label: 'Monthly',
+    label: t('report.monthly'),
     value: 'monthly'
   },
   {
-    label: 'Quarterly',
+    label: t('report.quarterly'),
     value: 'quarterly'
   },
   {
-    label: 'Yearly',
+    label: t('report.yearly'),
     value: 'yearly'
   }
 ])
 
 const weeklyCheckList = ref([
-  'Monday',
-  'Tuesday',
-  'Wednesday',
-  'Thursday',
-  'Friday',
-  'Saturday',
-  'Sunday'
+  t('report.monday'),
+  t('report.tuesday'),
+  t('report.wednesday'),
+  t('report.thursday'),
+  t('report.friday'),
+  t('report.saturday'),
+  t('report.sunday')
 ])
 const weeklyChecked = ref([])
 
 const monthlyChecked = ref([])
 
 const yearlyCheckList = ref([
-  'January',
-  'February',
-  'March',
-  'April',
-  'May',
-  'June',
-  'July',
-  'August',
-  'September',
-  'October',
-  'November',
-  'December'
+  t('report.january'),
+  t('report.february'),
+  t('report.march'),
+  t('report.april'),
+  t('report.may'),
+  t('report.june'),
+  t('report.july'),
+  t('report.august'),
+  t('report.september'),
+  t('report.october'),
+  t('report.november'),
+  t('report.december')
 ])
 
 const yearlyMonth = ref([])
 const dayValue = ref('')
 
-const quarterMonth = ref(['1st Month', '2nd Month', '3rd Month'])
+const quarterMonth = ref([t('report.firstMonth'), t('report.secondMonth'), t('report.thirdMonth')])
 const quarterMonthValue = ref('')
 
 // 切换frequency时,清空内容

+ 6 - 6
src/views/Report/src/components/ReportSchedule/src/components/FieldsTable.vue

@@ -23,11 +23,11 @@ watch(
 const manageReportFieldsRef = ref()
 const columnSortoptions = [
   {
-    label: 'ETA',
+    label: t('report.eta'),
     value: 'eta'
   },
   {
-    label: 'ETD',
+    label: t('report.etd'),
     value: 'etd'
   }
 ]
@@ -149,9 +149,9 @@ defineExpose({
   <div>
     <div class="SettingTable">
       <div class="flex">
-        <div class="title">Report Data Review</div>
+        <div class="title">{{ t('report.reportDataReview') }}</div>
         <div class="flex">
-          <span class="sort-text">Sort by:</span>
+          <span class="sort-text">{{ t('report.sortBy') }}</span>
           <el-select
             style="width: 160px; margin: 0 8px"
             v-model="orderBy"
@@ -166,7 +166,7 @@ defineExpose({
             />
           </el-select>
           <el-button type="default" @click="handleClickManageFields">
-            <span class="font_family icon-icon_set_b"></span>Manage Fields
+            <span class="font_family icon-icon_set_b"></span>{{ t('report.manageFields') }}
           </el-button>
           <ManageReportFields
             ref="manageReportFieldsRef"
@@ -191,7 +191,7 @@ defineExpose({
         </template>
       </vxe-grid>
       <div class="pagination">
-        <span>Total {{ formatNumber(pageInfo.total) }}</span>
+        <span>{{ t('common.total') }} {{ formatNumber(pageInfo.total) }}</span>
         <el-pagination
           v-model:current-page="pageInfo.pageNo"
           v-model:page-size="pageInfo.pageSize"

+ 6 - 6
src/views/TemplateManagement/src/components/CreateReportTemplate/src/CreateReportTemplate.vue

@@ -158,9 +158,7 @@ const handlePageSave = () => {
     !specificRoles.value.groupName?.length &&
     !specificRoles.value.systemAccount?.length
   ) {
-    ElMessage.warning(
-      t('templateManagement.specificRolesRequired')
-    )
+    ElMessage.warning(t('templateManagement.specificRolesRequired'))
     verified = false
   }
   if (!verified) {
@@ -185,10 +183,10 @@ const handlePageSave = () => {
     .saveNewReportTemplate({ ...data, serial_no })
     .then((res: any) => {
       if (res.code === 200) {
-        ElMessage.success(t('templateManagement.createReportTemplate.savedSuccessfully'))
+        ElMessage.success(t('templateManagement.savedSuccessfully'))
         router.push('/template-management')
       } else {
-        ElMessage.error(res.data.msg || t('templateManagement.createReportTemplate.saveFailed'))
+        ElMessage.error(res.data.msg || t('templateManagement.saveFailed'))
       }
     })
     .finally(() => {
@@ -288,7 +286,9 @@ const handlePageSave = () => {
                 <div class="radio-content">
                   <div class="top-options">
                     <p class="label">{{ t('templateManagement.specificRoles') }}</p>
-                    <p class="description">{{ t('templateManagement.specificRolesDescription') }}</p>
+                    <p class="description">
+                      {{ t('templateManagement.specificRolesDescription') }}
+                    </p>
                   </div>
                   <div
                     class="extended-filter"

+ 40 - 12
src/views/TemplateManagement/src/components/CreateReportTemplate/src/components/AdjustmentField.vue

@@ -415,7 +415,7 @@ defineExpose({
         </div>
       </div>
       <div class="right-select-columns">
-        <div class="title">Selected fields on report template list</div>
+        <div class="title">{{ t('templateManagement.selectedFieldsOnReportTemplateList') }}</div>
         <VueDraggable
           v-vloading="loading"
           v-model="selectColumns"
@@ -485,10 +485,22 @@ defineExpose({
       <el-tour-step :show-close="false" :target="step1?.[0]">
         <template #default>
           <div class="description">
-            <span>Drag</span> items to the right group or click the "<span>Add</span>" icon to add
-            columns to the {{ route.path.includes('booking') ? 'booking' : 'shipment' }} list.
+            <span>{{ t('templateManagement.drag') }}</span>
+            {{ t('templateManagement.dragOperaterTips1') }} "<span>{{
+              t('templateManagement.add')
+            }}</span
+            >"
+            {{ t('templateManagement.dragOperaterTips2') }}
+            {{
+              route.path.includes('booking')
+                ? t('templateManagement.booking')
+                : t('templateManagement.shipment')
+            }}
+            {{ t('templateManagement.list') }}.
+          </div>
+          <div class="got-it-text" @click="handleCloseTour('step1')">
+            {{ t('templateManagement.gotIt') }}
           </div>
-          <div class="got-it-text" @click="handleCloseTour('step1')">Got it</div>
         </template>
       </el-tour-step>
     </el-tour>
@@ -503,17 +515,33 @@ defineExpose({
       <el-tour-step :show-close="false" :target="step2?.[0]">
         <template #default>
           <div class="description">
-            <span>Drag</span> items to the left group or click the "<span>Remove</span>" icon to
-            delete columns from the
-            {{ route.path.includes('booking') ? 'booking' : 'shipment' }} list.
+            <span>{{ t('templateManagement.drag') }}</span>
+            {{ t('templateManagement.removeOperaterTips1') }} "<span>{{
+              t('templateManagement.remove')
+            }}</span
+            >"
+            {{ t('templateManagement.removeOperaterTips2') }}
+            {{
+              route.path.includes('booking')
+                ? t('templateManagement.booking')
+                : t('templateManagement.shipment')
+            }}
+            {{ t('templateManagement.list') }}
           </div>
           <div class="description">
-            <span>Drag</span> items up or down to reorder the
-            {{ route.path.includes('booking') ? 'booking' : 'shipment' }} list, or use the "<span
-              >Move up</span
-            >" and "<span>Move down</span>" icons.
+            <span>{{ t('templateManagement.drag') }}</span>
+            {{ t('templateManagement.dragItemsUpOrDownToReorderThe') }}
+            {{
+              route.path.includes('booking')
+                ? t('templateManagement.booking')
+                : t('templateManagement.shipment')
+            }}
+            {{ t('templateManagement.list') }},
+            {{ t('templateManagement.orUseTheMoveUpAndMoveDownIcons') }}
+          </div>
+          <div class="got-it-text" @click="handleCloseTour('step2')">
+            {{ t('templateManagement.gotIt') }}
           </div>
-          <div class="got-it-text" @click="handleCloseTour('step2')">Got it</div>
         </template>
       </el-tour-step>
     </el-tour>

+ 5 - 6
src/views/TemplateManagement/src/components/CreateReportTemplate/src/components/ReportFieldsConfiguration.vue

@@ -61,18 +61,17 @@ const changeReportLevel = (newVal: string, oldVal: string) => {
   const scenarios: Record<string, Record<string, { message: string; levelsToClear: string[] }>> = {
     'Item Level': {
       'Container Level': {
-        message: 'If the Level value is "Item Level", the field will be cleared.',
+        message: t('templateManagement.itemLevelWillBeCleared'),
         levelsToClear: ['Item Level']
       },
       'Shipment Level': {
-        message:
-          'If the Level value is "Item Level" or "Container Level", the field will be cleared.',
+        message: t('templateManagement.itemOrContainerLevelWillBeCleared'),
         levelsToClear: ['Item Level', 'Container Level']
       }
     },
     'Container Level': {
       'Shipment Level': {
-        message: 'If the Level value is "Container Level", the field will be cleared.',
+        message: t('templateManagement.containerLevelWillBeCleared'),
         levelsToClear: ['Container Level']
       }
     }
@@ -180,7 +179,7 @@ const handleCustomizeColumns = () => {
   AdjustmentFieldRef.value.openDialog(
     params,
     -220,
-    'Drag item over to this selection or click "add" icon to show the field on report template list',
+    t('templateManagement.dragItemAddOperaterTips'),
     uniqueArray
   )
 }
@@ -367,7 +366,7 @@ defineExpose({
               :name="fieldItem.uniqueId"
               class="display-name"
               v-model="fieldItem.displayName"
-              :placeholder="t('templateManagement.displayNameInReport')"
+              :placeholder="t('report.displayNameInReport')"
             ></el-input>
             <div class="actions">
               <div class="checkbox-group">

+ 6 - 1
src/views/TemplateManagement/src/components/TableView/src/TableView.vue

@@ -111,7 +111,12 @@ const handleColumns = (columns: any) => {
 // 获取表格列
 const getTableColumns = async () => {
   tableData.value.columns = [
-    { title: t('common.action'), width: 120, fixed: 'left', slots: { default: 'action' } },
+    {
+      title: t('templateManagement.action'),
+      width: 120,
+      fixed: 'left',
+      slots: { default: 'action' }
+    },
     ...handleColumns(tableColumns)
   ]
   // tableRef.value && autoWidth(tableData.value, tableRef.value)

+ 5 - 1
src/views/Tracking/src/components/PublicTracking/src/components/PublicTrackingDetail.vue

@@ -7,7 +7,9 @@ import { useOverflow } from '@/hooks/useOverflow'
 import { useThemeStore } from '@/stores/modules/theme'
 import { formatTimezone } from '@/utils/tools'
 import ShareLinkDialog from './ShareLinkDialog.vue'
+import { useI18n } from 'vue-i18n'
 
+const { t } = useI18n()
 const route = useRoute()
 
 const themeStore = useThemeStore()
@@ -94,7 +96,9 @@ const openShareDialog = () => {
           :class="[`icon-${transportationMode?.[allData?.transportInfo?.mode]}`]"
           style="font-size: 64px"
         ></span>
-        <div class="no">{{ t('tracking.houseNo') }} {{ allData?.transportInfo['Tracking No.'] }}</div>
+        <div class="no">
+          {{ t('tracking.tdHouseNo') }} {{ allData?.transportInfo['Tracking No.'] }}
+        </div>
         <VTag large :type="allData?.transportInfo?.status">{{
           allData?.transportInfo?.status
         }}</VTag>