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

@@ -2,9 +2,9 @@
<view :style="themeColor" :class="isIphoneX ? 'iphone-x' : ''">
<view class="cf-container color-line-border" v-if="storeToken">
<view class="tab">
<view @click="changeState(1)"><text :class="state == 1 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('tabUnused') }}</text></view>
<view @click="changeState(2)"><text :class="state == 2 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('tabUsed') }}</text></view>
<view @click="changeState(3)"><text :class="state == 3 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('tabExpired') }}</text></view>
<view @click="changeState(1)"><text :class="state == 1 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('member.coupon.tabUnused') }}</text></view>
<view @click="changeState(2)"><text :class="state == 2 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('member.coupon.tabUsed') }}</text></view>
<view @click="changeState(3)"><text :class="state == 3 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang('member.coupon.tabExpired') }}</text></view>
</view>
<!-- <view class="coupon-head">
<view class="sort" :class="sort == 1 ? 'color-base-border color-base-text' : ''" @click="changeSort(1, '')">全部</view>
@@ -30,36 +30,36 @@
{{ parseFloat(item.money) }}
</view>
<view class="use_price" v-else-if="item.type == 'discount'">
{{ $lang('discountText', { discount: parseFloat(item.discount) }) }}
{{ $lang('member.coupon.discountText', { discount: parseFloat(item.discount) }) }}
</view>
<view class="use_condition font-size-tag" v-if="item.at_least > 0">
{{ $lang('minAmountCondition', { amount: item.at_least }) }}</view>
<view class="use_condition font-size-tag" v-else>{{ $lang('noThresholdCoupon') }}</view>
{{ $lang('member.coupon.minAmountCondition', { amount: item.at_least }) }}</view>
<view class="use_condition font-size-tag" v-else>{{ $lang('member.coupon.noThresholdCoupon') }}</view>
</view>
</view>
<view class="item-info">
<view class="use_title">
<view class="title">{{ item.coupon_name }}</view>
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3" :class="{ disabled: item.state == 3 }">{{ $lang('specifiedGoods') }}</view>
<view class="max_price" v-if="item.discount_limit != '0.00'">{{ $lang('maxDiscount', { amount: item.discount_limit }) }}</view>
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3" :class="{ disabled: item.state == 3 }">{{ $lang('member.coupon.specifiedGoods') }}</view>
<view class="max_price" v-if="item.discount_limit != '0.00'">{{ $lang('member.coupon.maxDiscount', { amount: item.discount_limit }) }}</view>
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{ item.use_channel_name }}</view>
<!-- <view class="max_price truncate" v-if="item.use_channel!='online'" :class="{ disabled: item.useState == 2 }">
{{ item.use_store==='all'?'适用门店:全部门店': '适用门店:'+item.use_store_name}}
</view> -->
</view>
<view class="use_time" v-if="item.end_time">{{ $lang('validPeriodPrefix') }}{{ $util.timeStampTurnTime(item.end_time) }}
<view class="use_time" v-if="item.end_time">{{ $lang('member.coupon.validPeriodPrefix') }}{{ $util.timeStampTurnTime(item.end_time) }}
</view>
<view class="use_time" v-else>{{ $lang('validPeriodPrefix') }}{{ $lang('longTermValid') }}</view>
<view class="use_time" v-else>{{ $lang('member.coupon.validPeriodPrefix') }}{{ $lang('member.coupon.longTermValid') }}</view>
</view>
<view class="item-btn">
<view class="tag" v-if="item.state == 1">{{ $lang('useNow') }}</view>
<view class="tag disabled" v-if="item.state == 2">{{ $lang('used') }}</view>
<view class="tag disabled" v-if="item.state == 3">{{ $lang('expired') }}</view>
<view class="tag" v-if="item.state == 1">{{ $lang('member.coupon.useNow') }}</view>
<view class="tag disabled" v-if="item.state == 2">{{ $lang('member.coupon.used') }}</view>
<view class="tag disabled" v-if="item.state == 3">{{ $lang('member.coupon.expired') }}</view>
</view>
</view>
</view>
<view v-if="!list.length && showEmpty" class="margin-top cart-empty" :fixed="false">
<ns-empty :isIndex="true" :emptyBtn="{url: $util.INDEX_PAGE_URL,text: $lang('goShopping')}" :text="$lang('emptyText')"></ns-empty>
<ns-empty :isIndex="true" :emptyBtn="{url: $util.INDEX_PAGE_URL,text: $lang('member.coupon.goShopping')}" :text="$lang('member.coupon.emptyText')"></ns-empty>
</view>
</block>
</mescroll-uni>
@@ -88,7 +88,7 @@ export default {
this.$nextTick(() => {
if (!this.addonIsExist.coupon) {
this.$util.showToast({
title: this.$lang('merchantNotEnabled'),
title: this.$lang('member.coupon.merchantNotEnabled'),
mask: true,
duration: 2000
});