refactor: 国际化文本迁移至全局 locales/messages.js

将组件级 i18n 对象重构为统一由全局 locales/messages.js 管理,确保中英文语言切换时正确显示对应文本。

- 新增 utils/i18n.js 国际化工具函数
- 更新 store/$t.mixin.js 翻译混入逻辑
- 迁移 pkgService、pkgBooking、pkgAccount、pkgExplore、pages 等共 58 个组件的中英文文本至全局消息表
This commit is contained in:
liangjian
2026-07-24 13:43:41 +08:00
parent 445bd850f4
commit 6e721ccc7e
58 changed files with 1810 additions and 4065 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="section-panel room-section">
<view class="section-header tn-flex tn-flex-row-between tn-flex-col-center">
<text class="section-title">{{ t('roomSectionTitle', { count: roomTypes.length }) }}</text>
<text class="section-title">{{ $tr('在租房型({count})', { count: roomTypes.length }) }}</text>
</view>
<view class="room-list-vertical">
<view
@@ -28,11 +28,11 @@
<view class="room-bottom-v tn-flex tn-flex-row-between tn-flex-col-bottom">
<view class="room-price-v">
<text class="price-symbol">¥</text>
<text class="price-val">{{ formatPriceValue(room.price) || t('pricePending') }}</text>
<text class="price-unit">{{ t('priceUnit') }}</text>
<text class="price-val">{{ formatPriceValue(room.price) || $tr('待定') }}</text>
<text class="price-unit">{{ $tr('/月') }}</text>
</view>
<view class="go-btn-v tn-flex tn-flex-col-center tn-flex-row-center">
<text>{{ t('viewDetails') }}</text>
<text>{{ $tr('查看详情') }}</text>
<text class="tn-icon-right"></text>
</view>
</view>
@@ -65,9 +65,6 @@ export default {
}
},
methods: {
t(key, params = {}) {
return this.$tm('pkgExplore.store_detail.store_detail', key, params)
},
formatPriceValue(priceText) {
if (!priceText) {
return ''