feat: 新增多语言文案与组件国际化适配
本次提交完成了大量多语言相关的新增与优化工作: 1. 新增充值、案例、会员资产、订单等页面的中文/英文翻译文案 2. 新增企业微信客服、时间选择、支付弹窗等组件的多语言包 3. 优化工具函数与自定义页面的多语言适配,替换硬编码提示文案 4. 新增会员等级规则、积分商品、退款管理等页面的国际化支持 5. 修复企业微信JS-SDK的错误提示文案硬编码问题
This commit is contained in:
26
lang/en-us/components/ns-form.js
Normal file
26
lang/en-us/components/ns-form.js
Normal file
@@ -0,0 +1,26 @@
|
||||
export const lang = {
|
||||
// ===== ns-form component =====
|
||||
'nsForm': {
|
||||
// Selector placeholders
|
||||
selectPlaceholder: 'Please select',
|
||||
selectProvinceCity: 'Please select province and city',
|
||||
selectProvinceCityDistrict: 'Please select province, city and district',
|
||||
|
||||
// Validation - required
|
||||
pleaseInput: 'Please enter {title}',
|
||||
pleaseSelect: 'Please select {title}',
|
||||
pleaseSelectAtLeastOne: 'Please select at least one {title}',
|
||||
pleaseUploadAtLeastOne: 'Please upload at least one {title}',
|
||||
|
||||
// Validation - format
|
||||
idCardInvalid: 'Invalid ID card number',
|
||||
mobileInvalid: 'Invalid mobile number',
|
||||
|
||||
// Validation - range
|
||||
endDateBeforeStartDate: 'End date cannot be earlier than start date',
|
||||
endTimeBeforeStartTime: 'End time must be later than start time',
|
||||
|
||||
// Image upload
|
||||
maxUploadImages: 'Upload up to {max} images',
|
||||
}
|
||||
}
|
||||
31
lang/en-us/components/ns-payment.js
Normal file
31
lang/en-us/components/ns-payment.js
Normal file
@@ -0,0 +1,31 @@
|
||||
export const lang = {
|
||||
// ===== ns-payment component =====
|
||||
'nsPayment': {
|
||||
// Popup title
|
||||
paymentMethod: 'Payment Method',
|
||||
|
||||
// Pay amount
|
||||
payAmount: 'Pay {amount} CNY',
|
||||
|
||||
// Balance deduction
|
||||
balanceDeduction: 'Balance Deduction',
|
||||
availableBalance: 'Available ¥{amount}',
|
||||
|
||||
// Empty state
|
||||
noPaymentMethod: 'No payment methods configured yet!',
|
||||
|
||||
// Button
|
||||
confirmPay: 'Confirm Payment',
|
||||
|
||||
// Payment method names
|
||||
alipay: 'Alipay',
|
||||
wechatpay: 'WeChat Pay',
|
||||
|
||||
// Toast messages
|
||||
pleaseSelectPaymentMethod: 'Please select a payment method!',
|
||||
paying: 'Processing payment...',
|
||||
payInfoNotFound: 'Failed to get payment info!',
|
||||
paymentCancelled: 'Payment cancelled',
|
||||
paymentFailed: 'Payment failed, reason: {reason}',
|
||||
}
|
||||
}
|
||||
25
lang/en-us/components/ns-select-time.js
Normal file
25
lang/en-us/components/ns-select-time.js
Normal file
@@ -0,0 +1,25 @@
|
||||
export const lang = {
|
||||
// ===== ns-select-time component =====
|
||||
'nsSelectTime': {
|
||||
// Popup titles
|
||||
selectDeliveryTime: 'Select Delivery Time',
|
||||
selectPickupTime: 'Select Pickup Time',
|
||||
|
||||
// Date labels
|
||||
today: 'Today',
|
||||
tomorrow: 'Tomorrow',
|
||||
|
||||
// Week day names (Sunday to Saturday, index 0-6 matches getDay())
|
||||
sunday: 'Sun',
|
||||
monday: 'Mon',
|
||||
tuesday: 'Tue',
|
||||
wednesday: 'Wed',
|
||||
thursday: 'Thu',
|
||||
friday: 'Fri',
|
||||
saturday: 'Sat',
|
||||
|
||||
// Immediate delivery prefix/suffix (wraps time range, e.g. "Immediate delivery (09:00-10:00)")
|
||||
immediateDeliveryPrefix: 'Immediate delivery (',
|
||||
immediateDeliverySuffix: ')',
|
||||
}
|
||||
}
|
||||
31
lang/en-us/components/payment.js
Normal file
31
lang/en-us/components/payment.js
Normal file
@@ -0,0 +1,31 @@
|
||||
export const lang = {
|
||||
// ===== payment component =====
|
||||
payment: {
|
||||
// Popup title
|
||||
title: 'Payment Method',
|
||||
|
||||
// Pay amount
|
||||
payAmount: 'Pay {money} yuan',
|
||||
|
||||
// Balance payment
|
||||
balancePay: 'Balance Payment',
|
||||
availableBalance: 'Available {symbol}{balance}',
|
||||
|
||||
// Empty state
|
||||
noPaymentMethod: 'No payment method configured!',
|
||||
|
||||
// Button
|
||||
confirmPay: 'Confirm Payment',
|
||||
|
||||
// Payment method names
|
||||
alipay: 'Alipay',
|
||||
wechatpay: 'WeChat Pay',
|
||||
|
||||
// Toast messages
|
||||
pleaseSelectPayMethod: 'Please select a payment method!',
|
||||
paying: 'Paying...',
|
||||
payInfoNotFound: 'Payment info not found!',
|
||||
payCancelled: 'You have cancelled the payment',
|
||||
payFailed: 'Payment failed, reason: {reason}',
|
||||
}
|
||||
}
|
||||
27
lang/en-us/components/privacy-popup.js
Normal file
27
lang/en-us/components/privacy-popup.js
Normal file
@@ -0,0 +1,27 @@
|
||||
export const lang = {
|
||||
// ===== privacy-popup component =====
|
||||
privacyPopup: {
|
||||
// Popup title
|
||||
title: 'Privacy Protection Notice',
|
||||
|
||||
// Description text
|
||||
descPrefix: 'Thank you for using {appName}. Before using, please read and agree to the',
|
||||
descSuffix: '. When you tap "Agree and Continue", it means you have understood and agree to the terms, which will be legally binding on you. If you disagree, you will not be able to continue using {appName}.',
|
||||
|
||||
// Button text
|
||||
disagreeBtn: 'Disagree',
|
||||
agreeBtn: 'Agree and Continue',
|
||||
|
||||
// Default values - Mini Program
|
||||
defaultContractNameMp: 'User Privacy Protection Guide',
|
||||
defaultAppNameMp: 'this Mini Program',
|
||||
|
||||
// Default values - H5/Web
|
||||
defaultAppNameH5: 'this App',
|
||||
defaultContractNameH5: '《Privacy Policy》',
|
||||
defaultServiceNameH5: '《User Service Agreement》',
|
||||
|
||||
// Toast message
|
||||
disagreeTip: 'You have not agreed to the privacy policy, related features are unavailable',
|
||||
}
|
||||
}
|
||||
32
lang/en-us/components/register-reward.js
Normal file
32
lang/en-us/components/register-reward.js
Normal file
@@ -0,0 +1,32 @@
|
||||
export const lang = {
|
||||
// ===== register-reward component =====
|
||||
registerReward: {
|
||||
// Point reward
|
||||
pointReward: 'Point Reward',
|
||||
points: 'points',
|
||||
pointDesc: 'Use for cash deduction or product exchange',
|
||||
|
||||
// Growth value
|
||||
growthValue: 'Growth Value',
|
||||
growthDesc: 'Used to upgrade membership level',
|
||||
|
||||
// Balance reward
|
||||
balanceReward: 'Red Packet Reward',
|
||||
yuan: ' yuan',
|
||||
balanceDesc: 'Non-withdrawable, usable for orders',
|
||||
|
||||
// Coupon reward
|
||||
couponReward: 'Coupon Reward',
|
||||
|
||||
// Coupon description - with minimum spend
|
||||
couponMinSpendDiscount: 'Spend {atLeast}, get {discount}% off',
|
||||
couponMinSpendReduce: 'Spend {atLeast}, save {money}',
|
||||
|
||||
// Coupon description - no threshold
|
||||
couponNoThresholdDiscount: 'No threshold, {discount}% off',
|
||||
couponNoThresholdReduce: 'No threshold, save {money}',
|
||||
|
||||
// Action button
|
||||
viewNow: 'View Now',
|
||||
}
|
||||
}
|
||||
21
lang/en-us/components/wxwork-contact.js
Normal file
21
lang/en-us/components/wxwork-contact.js
Normal file
@@ -0,0 +1,21 @@
|
||||
export const lang = {
|
||||
// ===== wxwork-contact component =====
|
||||
wxworkContact: {
|
||||
// Default button text
|
||||
defaultBtnText: 'Add WeChat Work Customer Service',
|
||||
|
||||
// Confirm popup
|
||||
popupTitle: 'Add WeChat Work Customer Service',
|
||||
popupContent: 'After clicking confirm, you will be redirected to WeChat Work to add a professional customer service agent',
|
||||
cancelBtn: 'Cancel',
|
||||
confirmBtn: 'Confirm',
|
||||
|
||||
// Tips
|
||||
tipTitle: 'Tip',
|
||||
jumpSuccess: 'Jump successful',
|
||||
jumpFailed: 'Jump failed, please check WeChat Work configuration',
|
||||
notConfigured: 'WeChat Work customer service not configured',
|
||||
sdkNotInitialized: 'WeChat Work SDK not initialized',
|
||||
openProfileFailed: 'Failed to open user profile',
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user