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:
@@ -7,7 +7,7 @@
|
||||
<view class="cart-header" v-if="cartData.length">
|
||||
<view class="num-wrap">{{ $lang('goods.cart.totalKinds', { count: cartData[0].cartList.length }) }}</view>
|
||||
<view class="cart-action" @click="changeAction">
|
||||
{{ isAction ? $lang('complete') : $lang('edit') }}
|
||||
{{ isAction ? $lang('goods.cart.complete') : $lang('goods.cart.edit') }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart-wrap" v-for="(siteItem, siteIndex) in cartData" :key="siteIndex">
|
||||
@@ -131,7 +131,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-del color-base-bg" :class="{ show: item.edit }"
|
||||
@click="deleteCart('single', siteIndex, cartIndex)">{{ $lang('del') }}</view>
|
||||
@click="deleteCart('single', siteIndex, cartIndex)">{{ $lang('goods.cart.del') }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
@@ -235,7 +235,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-item total">
|
||||
<view class="title">{{ $lang('total') }}</view>
|
||||
<view class="title">{{ $lang('goods.cart.total') }}</view>
|
||||
<view class="money price-font ">{{ $lang('common.currencySymbol') }}{{ discount.order_money | moneyFormat }}</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -310,11 +310,11 @@
|
||||
<view class="all-election" @click="allElection">
|
||||
<view class="iconfont" :class="checkAll ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'">
|
||||
</view>
|
||||
<text>{{ $lang('allElection') }}</text>
|
||||
<text>{{ $lang('goods.cart.allElection') }}</text>
|
||||
</view>
|
||||
<view class="settlement-info" :style="{ visibility: isAction ? 'hidden' : 'visible' }">
|
||||
<view class="money">
|
||||
{{ $lang('total') }}:
|
||||
{{ $lang('goods.cart.total') }}:
|
||||
<text class="unit price-font">{{ $lang('common.currencySymbol') }}</text>
|
||||
<block v-if="Object.keys(discount).length">
|
||||
<text class="value price-font">{{ parseFloat(discount.order_money).toFixed(2).split('.')[0]
|
||||
@@ -333,14 +333,14 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="action-btn" v-if="isAction">
|
||||
<button type="primary" size="mini" class="mini" @click="deleteCart('all')">{{ $lang('del') }}</button>
|
||||
<button type="primary" size="mini" class="mini" @click="deleteCart('all')">{{ $lang('goods.cart.del') }}</button>
|
||||
</view>
|
||||
<view class="action-btn" v-else>
|
||||
<button type="primary" size="mini" class="mini" @click="settlement" v-if="totalCount != 0">
|
||||
{{ discount.coupon_info && discount.coupon_info.receive_type == 'wait' ? $lang('goods.cart.receiveCouponSettle', { count: totalCount }) : $lang('goods.cart.settleImmediately', { count: totalCount }) }}
|
||||
</button>
|
||||
<button type="primary" size="mini" class="mini" @click="settlement" disabled v-else>{{
|
||||
$lang('settlement') }}({{
|
||||
$lang('goods.cart.settlement') }}({{
|
||||
totalCount }})</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user