refactor: 统一项目内国际化key的命名空间格式

本次提交对全项目的国际化调用进行了规范化重构:
1. 为中文/英文语言包新增了avatar和gender的别名映射,兼容旧有headImg/sex写法
2. 修正了lang.js中的注释路径错误
3. 将所有页面和组件内的$lang调用从短路径改为带业务模块前缀的完整命名空间路径,例如将$lang('title')改为$lang('article.list.title')
4. 优化了i18n-lazy.js的注释说明,补充了正确的key命名格式示例
5. 统一了分销、订单、会员等模块的国际化key层级,确保所有语言调用路径一致
This commit is contained in:
2026-07-04 09:24:35 +08:00
parent 92e8823566
commit 783c10fc62
98 changed files with 1543 additions and 1530 deletions

View File

@@ -4,7 +4,7 @@
<!-- 搜索区域 -->
<view class="search-wrap uni-flex uni-row" style="margin-bottom: 20rpx;">
<view class="flex-item input-wrap">
<input class="uni-input" maxlength="50" v-model="keyword" @confirm="search()" :placeholder="$lang('searchPlaceholder')" />
<input class="uni-input" maxlength="50" v-model="keyword" @confirm="search()" :placeholder="$lang('merch.detail.searchPlaceholder')" />
<text class="iconfont icon-sousuo3" @click.stop="search()"></text>
</view>
<view class="iconfont" :class="{ 'icon-apps': isList, 'icon-list': !isList }" @click="changeListStyle()"></view>
@@ -28,11 +28,11 @@
<view class="scroll-desc">{{ merch.desc }}</view>
<view class="scroll-hint" v-if="isShowScrollHint">
<text class="scroll-icon">↓</text>
<text class="scroll-text">{{ $lang('desc.scrollUpToViewMore') }}</text>
<text class="scroll-text">{{ $lang('merch.detail.desc.scrollUpToViewMore') }}</text>
</view>
</view>
<view class="expand-tip" v-if="merch.desc && merch.desc.length > 50" @click.stop="toggleDesc">
<text class="hint-arrow">{{ isDescExpanded ? $lang('desc.collapse') : $lang('desc.expand') }}</text>
<text class="hint-arrow">{{ isDescExpanded ? $lang('merch.detail.desc.collapse') : $lang('merch.detail.desc.expand') }}</text>
</view>
</view>
</view>
@@ -42,14 +42,14 @@
<view class="sort-wrap">
<view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }"
@click="sortTabClick('')">
<text :class="{ 'color-base-text': orderType === '' }">{{ $lang('sort.comprehensive') }}</text>
<text :class="{ 'color-base-text': orderType === '' }">{{ $lang('merch.detail.sort.comprehensive') }}</text>
</view>
<view :class="{ 'color-base-text': orderType === 'sale_num' }" @click="sortTabClick('sale_num')">{{ $lang('sort.sales') }}
<view :class="{ 'color-base-text': orderType === 'sale_num' }" @click="sortTabClick('sale_num')">{{ $lang('merch.detail.sort.sales') }}
</view>
<view class="price-wrap" @click="sortTabClick('discount_price')">
<text :class="{ 'color-base-text': orderType === 'discount_price' }">{{ $lang('sort.price') }}</text>
<text :class="{ 'color-base-text': orderType === 'discount_price' }">{{ $lang('merch.detail.sort.price') }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-iconangledown-copy asc"
:class="{ 'color-base-text': priceOrder === 'asc' && orderType === 'discount_price' }">
@@ -61,7 +61,7 @@
</view>
<view :class="{ 'color-base-text': orderType === 'screen' }" class="screen-wrap" @click="showScreen = true">
<text @click="showScreen = true">{{ $lang('sort.filter') }}</text>
<text @click="showScreen = true">{{ $lang('merch.detail.sort.filter') }}</text>
<view @click="showScreen = true" class="iconfont-wrap">
<view class="iconfont icon-shaixuan color-tip"></view>
</view>
@@ -99,7 +99,7 @@
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
</view>
<view class="discount-price" v-else>
<text class="price price-style large">{{ $lang('goods.consultNow') }}</text>
<text class="price price-style large">{{ $lang('merch.detail.goods.consultNow') }}</text>
</view>
@@ -117,7 +117,7 @@
<text>{{ showMarketPrice(item) }}</text>
</view>
<view class="block-wrap">
<view class="sale color-tip" v-if="item.sale_show">{{ $lang('goods.sold', { num: item.sale_num, unit: item.unit ? item.unit : $lang('goods.defaultUnit') }) }}</view>
<view class="sale color-tip" v-if="item.sale_show">{{ $lang('merch.detail.goods.sold', { num: item.sale_num, unit: item.unit ? item.unit : $lang('merch.detail.goods.defaultUnit') }) }}</view>
</view>
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
<!-- 购物车图标 -->
@@ -191,7 +191,7 @@
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
</view>
<view class="discount-price" v-else>
<text class="price price-style large">{{ $lang('goods.consultNow') }}</text>
<text class="price price-style large">{{ $lang('merch.detail.goods.consultNow') }}</text>
</view>
<view class="member-price-tag"
v-if="item.member_price && item.member_price == showPrice(item)">
@@ -207,7 +207,7 @@
</view>
<view class="pro-info" v-if="item.isinformation == 0">
<view class="block-wrap">
<view class="sale color-tip" v-if="item.sale_show">{{ $lang('goods.sold', { num: item.sale_num, unit: item.unit ? item.unit : $lang('goods.defaultUnit') }) }}</view>
<view class="sale color-tip" v-if="item.sale_show">{{ $lang('merch.detail.goods.sold', { num: item.sale_num, unit: item.unit ? item.unit : $lang('merch.detail.goods.defaultUnit') }) }}</view>
</view>
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
<!-- 购物车图标 -->
@@ -254,7 +254,7 @@
</view>
</view>
</view>
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty :text="$lang('goods.noGoods')"></ns-empty></view>
<view v-if="goodsList.length == 0 && emptyShow"><ns-empty :text="$lang('merch.detail.goods.noGoods')"></ns-empty></view>
</block>
</mescroll-uni>
@@ -262,7 +262,7 @@
<!-- 筛选弹出框 -->
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
<view class="title color-tip">{{ $lang('filter.title') }}</view>
<view class="title color-tip">{{ $lang('merch.detail.filter.title') }}</view>
<scroll-view scroll-y>
<!-- 包邮 -->
<!-- <view class="item-wrap">
@@ -294,10 +294,10 @@
<!-- 分类筛选项 -->
<view class="category-list-wrap">
<text class="first">{{ $lang('filter.allCategories') }}</text>
<text class="first">{{ $lang('merch.detail.filter.allCategories') }}</text>
<view class="class-box">
<view @click="selectedCategory('')" class="list-wrap">
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ $lang('filter.all') }}</text>
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ $lang('merch.detail.filter.all') }}</text>
</view>
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList"
:key="index" class="list-wrap">
@@ -309,8 +309,8 @@
</view>
</scroll-view>
<view class="footer" :class="{ 'safe-area': isIphoneX }">
<button type="default" class="footer-box" @click="resetData">{{ $lang('filter.reset') }}</button>
<button type="primary" class="footer-box1" @click="screenData">{{ $lang('filter.confirm') }}</button>
<button type="default" class="footer-box" @click="resetData">{{ $lang('merch.detail.filter.reset') }}</button>
<button type="primary" class="footer-box1" @click="screenData">{{ $lang('merch.detail.filter.confirm') }}</button>
</view>
</uni-drawer>
<loading-cover ref="loadingCover"></loading-cover>