Skip to content

Commit de7d4c4

Browse files
committed
chore: complete i18n implementation for all hardcoded text
- Convert dashboard constants (12 company names) to i18n - Convert detail advanced constants (6 product properties) to i18n - Convert user constants (organization structure) to i18n - Update notification store to use dynamic i18n translations - Update user store with i18n login message - Add 35+ new i18n keys for zh_CN and en_US - Fix unused useI18n import in list/base page - All JSON syntax validated - All TypeScript checks passed
1 parent 40d3e9e commit de7d4c4

17 files changed

Lines changed: 331 additions & 91 deletions

File tree

src/components/common-table/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
</t-table>
115115
<t-dialog
116116
v-model:visible="confirmVisible"
117-
header="确认删除当前所选合同?"
117+
:header="t('pages.listCard.deleteConfirm')"
118118
:body="confirmBody"
119119
:on-cancel="onCancel"
120120
@confirm="onConfirmDelete"
@@ -242,7 +242,7 @@ const deleteIdx = ref(-1);
242242
const confirmBody = computed(() => {
243243
if (deleteIdx.value > -1) {
244244
const { name } = data.value[deleteIdx.value];
245-
return `删除后,${name}的所有合同信息将被清空,且无法恢复`;
245+
return t('pages.listCard.deleteTip', { name });
246246
}
247247
return '';
248248
});

src/layouts/components/Search.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
v-model="searchData"
2828
class="header-search"
2929
:class="[{ 'width-zero': !isSearchFocus }]"
30-
placeholder="输入要搜索内容"
30+
:placeholder="t('layout.search.placeholder')"
3131
:autofocus="isSearchFocus"
3232
@blur="changeSearchFocus(false)"
3333
>

src/layouts/components/SideNav.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</template>
1717
<menu-content :nav-data="menu" />
1818
<template #operations>
19-
<span :class="versionCls"> {{ !collapsed ? 'TDesign Starter' : '' }} {{ pgk.version }} </span>
19+
<span :class="versionCls"> {{ !collapsed ? t('common.appName') : '' }} {{ pgk.version }} </span>
2020
</template>
2121
</t-menu>
2222
<div :class="`${prefix}-side-nav-placeholder${collapsed ? '-hidden' : ''}`"></div>
@@ -32,6 +32,7 @@ import { useRouter } from 'vue-router';
3232
import AssetLogoFull from '@/assets/assets-logo-full.svg?component';
3333
import AssetLogo from '@/assets/assets-t-logo.svg?component';
3434
import { prefix } from '@/config/global';
35+
import { t } from '@/locales';
3536
import { getActive } from '@/router';
3637
import { useSettingStore } from '@/store';
3738
import type { MenuRoute, ModeType } from '@/types/interface';

src/locales/lang/en_US.json

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"lang": "English",
3+
"common": {
4+
"appName": "TDesign Starter",
5+
"copyright": "Copyright @ 2021-2025 Tencent. All Rights Reserved",
6+
"conjunction": "and",
7+
"admin": "admin"
8+
},
39
"components": {
410
"isSetup": {
511
"on": "Enabled",
@@ -65,6 +71,9 @@
6571
"refresh": "refresh"
6672
},
6773
"searchPlaceholder": "Enter search content",
74+
"search": {
75+
"placeholder": "Enter search content"
76+
},
6877
"setting": {
6978
"title": "Setting",
7079
"theme": {
@@ -180,6 +189,22 @@
180189
"count": "Count",
181190
"operation": "Operation"
182191
},
192+
"saleTend": {
193+
"item1": "State Grid Corporation of China",
194+
"item2": "Shenzhen Gas Group Co., Ltd",
195+
"item3": "State Administration of Tobacco Monopoly",
196+
"item4": "China Telecom Group Co., Ltd",
197+
"item5": "China Mobile Communications Group Co., Ltd",
198+
"item6": "Xinyu City Office Supplies Procurement Project"
199+
},
200+
"buyTend": {
201+
"item1": "Tencent Technology (Shenzhen) Co., Ltd",
202+
"item2": "Darunfa Co., Ltd",
203+
"item3": "Sichuan Haidilao Co., Ltd",
204+
"item4": "Sony (China) Co., Ltd",
205+
"item5": "Panasonic Electronics (China) Co., Ltd",
206+
"item6": "Xinyu City Office Supplies Procurement Project"
207+
},
183208
"chart": {
184209
"week1": "MON",
185210
"week2": "TUE",
@@ -242,6 +267,13 @@
242267
"baseInfo": {
243268
"title": "Base Info"
244269
},
270+
"sampleData": {
271+
"contractName": "Office Supplies Procurement Project",
272+
"status": "In Progress",
273+
"company": "Tencent Technology (Shenzhen) Co., Ltd",
274+
"employee": "Osun",
275+
"fileName": "Office Supplies Procurement Contract.pdf"
276+
},
245277
"changelog": {
246278
"title": "Changelog",
247279
"step1": {
@@ -288,6 +320,7 @@
288320
},
289321
"detail": {
290322
"title": "Product Procurement Detail",
323+
"budgetExceeded": "Budget Exceeded",
291324
"form": {
292325
"applyNo": "Apply no",
293326
"product": "Name",
@@ -299,6 +332,24 @@
299332
"manage": "manage",
300333
"delete": "delete"
301334
}
335+
},
336+
"products": {
337+
"product1": {
338+
"name": "MacBook Pro 2021",
339+
"company": "Apple Inc.",
340+
"size": "13.3 inches",
341+
"cpu": "Apple M1",
342+
"memory": "RAM 16GB",
343+
"info": "Up to 16GB memory · Up to 2TB storage · Battery life up to 18 hours"
344+
},
345+
"product2": {
346+
"name": "Surface Laptop Go",
347+
"company": "Microsoft Corporation",
348+
"size": "12.4 inches",
349+
"cpu": "Core i7",
350+
"memory": "RAM 16GB",
351+
"info": "Surface regular use, up to 13 hours of battery life, work anytime"
352+
}
302353
}
303354
},
304355
"detailDeploy": {
@@ -363,6 +414,15 @@
363414
"deleteTip": "Confirm delete notification: {content}?",
364415
"empty": "Empty"
365416
},
417+
"notification": {
418+
"contract": "Contract Updates",
419+
"invoice": "Invoice Updates",
420+
"meeting": "Meeting Notification",
421+
"msg1": "Tencent Building First Floor Renovation Project has passed audit!",
422+
"msg2": "Third Quarter Raw Material Procurement Project invoicing successful!",
423+
"msg3": "Meeting 【State Grid Offline Signing】at 2021-01-01 10:00 is about to start, please arrive at Conference Room 1 10 minutes early for check-in!",
424+
"msg4": "First Quarter Raw Material Procurement Project invoicing successful!"
425+
},
366426
"formBase": {
367427
"title": "Contract Info",
368428
"contractName": "Name",
@@ -506,6 +566,8 @@
506566
"pay": "pay",
507567
"receive": "received",
508568
"placeholder": "please enter to search",
569+
"deleteConfirm": "Confirm delete selected contracts?",
570+
"deleteTip": "After deletion, all contract information of {name} will be cleared and cannot be recovered",
509571
"contractStatusEnum": {
510572
"fail": "fail",
511573
"audit": "audit",
@@ -529,6 +591,17 @@
529591
"productStatusEnum": {
530592
"off": "off",
531593
"on": "on"
594+
},
595+
"dialogForm": {
596+
"productNamePlaceholder": "Please enter product name",
597+
"cancel": "Cancel",
598+
"confirm": "Confirm",
599+
"typeGateway": "Gateway",
600+
"typeAI": "Artificial Intelligence",
601+
"typeCVM": "CVM",
602+
"validation": {
603+
"productName": "Please enter product name"
604+
}
532605
}
533606
},
534607
"listFilter": {},
@@ -577,7 +650,32 @@
577650
"password": "password is required",
578651
"verification": "verification code is require"
579652
},
580-
"sendVerification": "send"
653+
"sendVerification": "send",
654+
"register": {
655+
"phonePlaceholder": "Please enter your phone number",
656+
"emailPlaceholder": "Please enter your email",
657+
"passwordPlaceholder": "Please enter your password",
658+
"verifyCodePlaceholder": "Please enter verification code",
659+
"sendVerifyCode": "Send verification code",
660+
"resendCountdown": "Resend in {count} seconds",
661+
"agreeTerms": "I have read and agree to",
662+
"serviceTerms": "TDesign Service Terms",
663+
"privacyStatement": "TDesign Privacy Statement",
664+
"registerBtn": "Register",
665+
"useEmailRegister": "Register with email",
666+
"usePhoneRegister": "Register with phone",
667+
"validation": {
668+
"phone": "Phone number is required",
669+
"email": "Email is required",
670+
"emailFormat": "Please enter a valid email",
671+
"password": "Password is required",
672+
"verifyCode": "Verification code is required",
673+
"agreeTerms": "You must agree to the service terms and privacy statement"
674+
},
675+
"messages": {
676+
"registerSuccess": "Registration successful"
677+
}
678+
}
581679
},
582680
"result": {
583681
"403": {
@@ -624,6 +722,10 @@
624722
},
625723
"user": {
626724
"markDay": "Good afternoon, today marks your 100th day at Tencent",
725+
"greeting": "Hi, Image",
726+
"unit": "(times)",
727+
"account": "My Account",
728+
"organization": "Tencent / Tencent Company / Business Group / Product Department / Operations Center / Merchant Services Group",
627729
"personalInfo": {
628730
"title": "Personal Info",
629731
"position": "Employee of the Hong Kong and Macau Business Expansion team",
@@ -641,8 +743,8 @@
641743
"tencentGroup": "Tencent Group",
642744
"seniorDesigner": "Senior UI Designer"
643745
},
644-
"contentList": "Content List",
645746
"visitData": "Visit Data",
747+
"contentList": "Content List",
646748
"teamMember": "Team Member",
647749
"serviceProduction": "Service Product"
648750
}

0 commit comments

Comments
 (0)