refactor(i18n): 扁平化多语言文件结构,移除嵌套的components对象

统一调整所有组件级多语言配置,将原有的components.[componentName]嵌套结构改为直接顶层键值对,简化语言包的调用层级
This commit is contained in:
2026-06-30 16:53:53 +08:00
parent eef59211d3
commit 4adaa945a1
20 changed files with 141 additions and 223 deletions

View File

@@ -1,11 +1,7 @@
export const lang = { export const lang = {
// chat-message component // chat-message component
components: { // Customer service offline hint
chatMessage: { customerOffline: 'Customer service is offline',
// Customer service offline hint // Customer service online hint
customerOffline: 'Customer service is offline', customerOnline: 'Customer service is online',
// Customer service online hint
customerOnline: 'Customer service is online',
},
},
} }

View File

@@ -1,22 +1,17 @@
export const lang = { export const lang = {
// mescroll pull-down refresh / pull-up load component // mescroll pull-down refresh / pull-up load component
components: { down: {
mescroll: { textInOffset: 'Pull to refresh',
// pull-down refresh text textOutOffset: 'Release to update',
down: { textLoading: 'Loading ...',
textInOffset: 'Pull to refresh', },
textOutOffset: 'Release to update', // pull-up load text
textLoading: 'Loading ...', up: {
}, textLoading: 'Loading ...',
// pull-up load text textNoMore: '-- END --',
up: { },
textLoading: 'Loading ...', // empty layout tip
textNoMore: '-- END --', empty: {
}, tip: '~ No data ~',
// empty layout tip
empty: {
tip: '~ No data ~',
},
}, },
},
} }

View File

@@ -1,11 +1,7 @@
export const lang = { export const lang = {
// ns-chat-goods chat goods component // ns-chat-goods chat goods component
components: { // Sent status
chatGoods: { sent: 'Sent',
// Sent status // Send button
sent: 'Sent', send: 'Send',
// Send button
send: 'Send',
},
},
} }

View File

@@ -1,13 +1,9 @@
export const lang = { export const lang = {
// ns-chat-receiveGoods chat received goods component // ns-chat-receiveGoods chat received goods component
components: { // Stock prefix
chatReceiveGoods: { stockPrefix: 'Stock:',
// Stock prefix // Sales prefix
stockPrefix: 'Stock:', salesPrefix: 'Sales:',
// Sales prefix // View goods button
salesPrefix: 'Sales:', viewGoods: 'View Product',
// View goods button
viewGoods: 'View Product',
},
},
} }

View File

@@ -1,9 +1,5 @@
export const lang = { export const lang = {
// ns-goods-sku product SKU component // ns-goods-sku product SKU component
components: { // Point suffix: {point} is the points amount placeholder
nsGoodsSku: { pointSuffix: '{point} points',
// Point suffix: {point} is the points amount placeholder
pointSuffix: '{point} points',
},
},
} }

View File

@@ -1,9 +1,5 @@
export const lang = { export const lang = {
// ns-video-player-popup video popup component // ns-video-player-popup video popup component
components: { // Video URL does not exist hint
videoPlayerPopup: { videoUrlNotExist: 'Video URL does not exist',
// Video URL does not exist hint
videoUrlNotExist: 'Video URL does not exist',
},
},
} }

View File

@@ -1,15 +1,11 @@
export const lang = { export const lang = {
// ns-chat-order order message component // ns-chat-order order message component
components: { // order status label: {status} is the order status value placeholder
nsChatOrder: { orderStatus: 'Order Status: {status}',
// order status label: {status} is the order status value placeholder // delivery method label: {method} is the delivery method value placeholder
orderStatus: 'Order Status: {status}', deliveryMethod: 'Delivery Method: {method}',
// delivery method label: {method} is the delivery method value placeholder // send button
deliveryMethod: 'Delivery Method: {method}', send: 'Send',
// send button // sent button (disabled state)
send: 'Send', sent: 'Sent',
// sent button (disabled state)
sent: 'Sent',
},
},
} }

View File

@@ -1,13 +1,9 @@
export const lang = { export const lang = {
// ns-contact customer service component // ns-contact customer service component
components: { // popup title
nsContact: { contactService: 'Contact Customer Service',
// popup title // customer service phone tip: {phone} is the phone number placeholder
contactService: 'Contact Customer Service', callServiceTip: 'Please contact customer service at {phone}',
// customer service phone tip: {phone} is the phone number placeholder // no customer service message
callServiceTip: 'Please contact customer service at {phone}', noServiceOffline: 'Sorry, no customer service available, please contact offline',
// no customer service message
noServiceOffline: 'Sorry, no customer service available, please contact offline',
},
},
} }

View File

@@ -1,11 +1,7 @@
export const lang = { export const lang = {
// pick-regions region picker component // pick-regions region picker component
components: { // Cancel button
pickRegions: { cancel: 'Cancel',
// Cancel button // Confirm button
cancel: 'Cancel', confirm: 'Done',
// Confirm button
confirm: 'Done',
},
},
} }

View File

@@ -1,33 +1,29 @@
export const lang = { export const lang = {
// ===== yuyue-date component ===== // ===== yuyue-date component =====
components: { // Appointed date button
yuyueDate: { appointedDate: 'Appointed Date',
// Appointed date button
appointedDate: 'Appointed Date',
// Time status text // Time status text
fullyBooked: 'Fully Booked', fullyBooked: 'Fully Booked',
available: 'Available', available: 'Available',
// Selection status // Selection status
noSelection: 'No Selection', noSelection: 'No Selection',
// Toast message // Toast message
weekdayCannotBook: '{weekday} cannot be booked', weekdayCannotBook: '{weekday} cannot be booked',
// Near-day labels // Near-day labels
today: 'Today', today: 'Today',
tomorrow: 'Tomorrow', tomorrow: 'Tomorrow',
dayAfterTomorrow: 'Day After Tomorrow', dayAfterTomorrow: 'Day After Tomorrow',
// Week day names (index 0-6 = Sunday through Saturday, matching Date.getDay()) // Week day names (index 0-6 = Sunday through Saturday, matching Date.getDay())
weekSunday: 'Sun', weekSunday: 'Sun',
weekMonday: 'Mon', weekMonday: 'Mon',
weekTuesday: 'Tue', weekTuesday: 'Tue',
weekWednesday: 'Wed', weekWednesday: 'Wed',
weekThursday: 'Thu', weekThursday: 'Thu',
weekFriday: 'Fri', weekFriday: 'Fri',
weekSaturday: 'Sat', weekSaturday: 'Sat',
}
}
} }

View File

@@ -1,11 +1,6 @@
export const lang = { export const lang = {
// chat-message 组件 // 客服不在线提示
components: { customerOffline: '客服不在线',
chatMessage: { // 客服在线提示
// 客服不在线提示 customerOnline: '客服在线',
customerOffline: '客服不在线',
// 客服在线提示
customerOnline: '客服在线',
},
},
} }

View File

@@ -1,22 +1,18 @@
export const lang = { export const lang = {
// mescroll 下拉刷新/上拉加载组件 // mescroll 下拉刷新/上拉加载组件
components: { // 下拉刷新提示文本
mescroll: { down: {
// 下拉刷新提示文本 textInOffset: '下拉刷新',
down: { textOutOffset: '释放更新',
textInOffset: '下拉刷新', textLoading: '加载中 ...',
textOutOffset: '释放更新', },
textLoading: '加载中 ...', // 上拉加载提示文本
}, up: {
// 上拉加载提示文本 textLoading: '加载中 ...',
up: { textNoMore: '-- END --',
textLoading: '加载中 ...', },
textNoMore: '-- END --', // 空布局提示
}, empty: {
// 空布局提示 tip: '~ 暂无相关数据 ~',
empty: {
tip: '~ 暂无相关数据 ~',
},
},
}, },
} }

View File

@@ -1,11 +1,7 @@
export const lang = { export const lang = {
// ns-chat-goods 聊天商品组件 // ns-chat-goods 聊天商品组件
components: { // 已发送状态
chatGoods: { sent: '已发送',
// 已发送状态 // 发送按钮
sent: '已发送', send: '发送',
// 发送按钮
send: '发送',
},
},
} }

View File

@@ -1,13 +1,9 @@
export const lang = { export const lang = {
// ns-chat-receiveGoods 聊天收到商品组件 // ns-chat-receiveGoods 聊天收到商品组件
components: { // 库存前缀
chatReceiveGoods: { stockPrefix: '库存:',
// 库存前缀 // 销量前缀
stockPrefix: '库存:', salesPrefix: '销量:',
// 销量前缀 // 查看商品按钮
salesPrefix: '销量:', viewGoods: '查看商品',
// 查看商品按钮
viewGoods: '查看商品',
},
},
} }

View File

@@ -1,9 +1,5 @@
export const lang = { export const lang = {
// ns-goods-sku 商品 SKU 组件 // ns-goods-sku 商品 SKU 组件
components: { // 积分后缀: {point} 为积分数量占位符
nsGoodsSku: { pointSuffix: '{point}积分',
// 积分后缀: {point} 为积分数量占位符
pointSuffix: '{point}积分',
},
},
} }

View File

@@ -1,9 +1,5 @@
export const lang = { export const lang = {
// ns-video-player-popup 视频弹窗组件 // ns-video-player-popup 视频弹窗组件
components: { // 视频地址不存在提示
videoPlayerPopup: { videoUrlNotExist: '视频地址不存在',
// 视频地址不存在提示
videoUrlNotExist: '视频地址不存在',
},
},
} }

View File

@@ -1,15 +1,11 @@
export const lang = { export const lang = {
// ns-chat-order 订单消息组件 // ns-chat-order 订单消息组件
components: { // 订单状态标签: {status} 为订单状态值占位符
nsChatOrder: { orderStatus: '订单状态:{status}',
// 订单状态标签: {status} 为订单状态值占位符 // 配送方式标签: {method} 为配送方式值占位符
orderStatus: '订单状态:{status}', deliveryMethod: '配送方式:{method}',
// 配送方式标签: {method} 为配送方式值占位符 // 发送按钮
deliveryMethod: '配送方式:{method}', send: '发送',
// 发送按钮 // 已发送按钮(禁用状态)
send: '发送', sent: '已发送',
// 已发送按钮(禁用状态)
sent: '已发送',
},
},
} }

View File

@@ -1,13 +1,9 @@
export const lang = { export const lang = {
// ns-contact 客服组件 // ns-contact 客服组件
components: { // 弹窗标题
nsContact: { contactService: '联系客服',
// 弹窗标题 // 客服电话提示: {phone} 为电话号码占位符
contactService: '联系客服', callServiceTip: '请联系客服,客服电话是 {phone}',
// 客服电话提示: {phone} 为电话号码占位符 // 无客服提示
callServiceTip: '请联系客服,客服电话是 {phone}', noServiceOffline: '抱歉,商家暂无客服,请线下联系',
// 无客服提示
noServiceOffline: '抱歉,商家暂无客服,请线下联系',
},
},
} }

View File

@@ -1,11 +1,7 @@
export const lang = { export const lang = {
// pick-regions 地区选择组件 // pick-regions 地区选择组件
components: { // 取消按钮
pickRegions: { cancel: '取消',
// 取消按钮 // 完成按钮
cancel: '取消', confirm: '完成',
// 完成按钮
confirm: '完成',
},
},
} }

View File

@@ -1,33 +1,29 @@
export const lang = { export const lang = {
// ===== yuyue-date 组件 ===== // ===== yuyue-date 组件 =====
components: { // 指定日期按钮
yuyueDate: { appointedDate: '指定日期',
// 指定日期按钮
appointedDate: '指定日期',
// 时间状态文本 // 时间状态文本
fullyBooked: '已约满', fullyBooked: '已约满',
available: '可预约', available: '可预约',
// 选中状态 // 选中状态
noSelection: '暂无选择', noSelection: '暂无选择',
// Toast 提示 // Toast 提示
weekdayCannotBook: '{weekday}不可以预约', weekdayCannotBook: '{weekday}不可以预约',
// 近三天日期标签 // 近三天日期标签
today: '今天', today: '今天',
tomorrow: '明天', tomorrow: '明天',
dayAfterTomorrow: '后天', dayAfterTomorrow: '后天',
// 星期完整名称(索引 0-6 对应周日到周六,与 Date.getDay() 返回值一致) // 星期完整名称(索引 0-6 对应周日到周六,与 Date.getDay() 返回值一致)
weekSunday: '周日', weekSunday: '周日',
weekMonday: '周一', weekMonday: '周一',
weekTuesday: '周二', weekTuesday: '周二',
weekWednesday: '周三', weekWednesday: '周三',
weekThursday: '周四', weekThursday: '周四',
weekFriday: '周五', weekFriday: '周五',
weekSaturday: '周六', weekSaturday: '周六',
}
}
} }