chore(i18n): 清理死代码 + 遗留 lang 文件 + 旧工具

## 删除的死代码脚本
- scripts/i18n_class_c.py (脚本自承'新架构下永远输出 0',纯防御性)
- scripts/full_migrate_i18n.py (其产出违反 CLAUDE.md 1.2 中文 key 铁律,已标 DEPRECATED)
- scripts/__pycache__/ (Python 缓存)

## 删除的旧 per-page lang 文件
- lang/zh-cn/<page>/<file>.js (140 个)
- lang/en-us/<page>/<file>.js (139 个)
- 共 279 个文件,运行时不再加载,0 个 key 被 .vue 调用(经 diagnose_keys.py 验证)

## 删除的备份和迁移表
- lang/_backup/ (git 已跟踪原文件)
- lang/_migration_map.json / lang/_migration-map.json (运行时不用)

## 删除的中间产物 JSON
- docs/i18n-rename-*.json (smart_rename 中间产物,已用完)
- docs/i18n-ambiguous.json / i18n-audit.json / i18n-call-rewrite.log /
  i18n-clean-dead.log / i18n-file-texts.json / i18n-page-titles.json /
  i18n-vue-extract.json (前一会话残留,无引用方)
- docs/i18n-{naming,shadow,strict}-audit.json (脚本会自动重新生成)

## 删除的 modular lang 文件
- lang/zh-cn/*.js / lang/en-us/*.js (20 个模块文件,内容是上一会话产生的死代码)
- lang/zh-cn/index.js / lang/en-us/index.js (聚合入口)
- lang/DEPRECATED.md (已不再相关)

## 删除的不成熟脚本
- scripts/check_perpage.py (诊断用,已完成)
- scripts/diagnose_keys.py (诊断用,已完成)
- scripts/smart_rename_i18n.py (v1-v3 都 bug,未修完)

## 现状
- lang/ 现在只有 zh-cn.js + en-us.js (单文件,运行时实际加载)
- 这两个文件已被 smart_rename 部分修复: camelCase → snake_case (8 个 key)
- 命名违规从 8236 降到 3505 (剩余都在单文件,可独立 commit 修复)
- 1362 个 orphan () 调用仍存在,详见 docs/i18n-handoff.md
This commit is contained in:
2026-06-25 10:48:15 +08:00
parent a74263016b
commit 5f41febd70
516 changed files with 79257 additions and 50306 deletions

View File

@@ -26,16 +26,16 @@
</view>
<view class="coupon-num" :style="{ color: value.moneyColor }" v-else>
<text class="coupon-size">{{ item.discount | moneyConduct }}</text>
<text class="font-size-tag coupon-sign">折</text>
<text class="font-size-tag coupon-sign">{{ $lang("common.register-reward.l60.t1") }}</text>
</view>
<view class="coupon-type font-size-tag" :style="{ color: value.limitColor }">
{{ item.at_least > 0 ? '满' + Number(item.at_least) + '元可用' : '无门槛优惠券' }}
{{ item.at_least > 0 ? $lang('diy.diy-coupon.l32.t0') + Number(item.at_least) + '元可用' : $lang('diy.diy-coupon.l32.t2') }}
</view>
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="item.useState == 0">
{{ value.btnStyle.text }}
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="parseInt(item.useState)">去使用</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="parseInt(item.useState)">{{ $lang("diy.diy-coupon.l38.t0") }}</view>
</view>
</swiper-item>
@@ -61,14 +61,14 @@
</view>
<view class="coupon-num" :style="{ color: value.moneyColor }" v-else>
<text class="coupon-size">{{ item.discount | moneyConduct }}</text>
<text class="font-size-tag coupon-sign">折</text>
<text class="font-size-tag coupon-sign">{{ $lang("common.register-reward.l60.t1") }}</text>
</view>
<view class="coupon-type font-size-tag" :style="{ color: value.limitColor }">
{{ item.at_least > 0 ? '满' + Number(item.at_least) + '元可用' : '无门槛优惠券' }}
{{ item.at_least > 0 ? $lang('diy.diy-coupon.l32.t0') + Number(item.at_least) + '元可用' : $lang('diy.diy-coupon.l32.t2') }}
</view>
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="item.useState == 0">
{{ value.btnStyle.text || '领取' }}
{{ value.btnStyle.text || $lang('diy.diy-coupon.l71.t0') }}
</view>
<view class="coupon-get use" :style="couponBtnStyle" v-if="parseInt(item.useState)">去使用
</view>
@@ -95,20 +95,20 @@
</view>
<view class="coupon-num" :style="{ color: value.moneyColor }" v-else>
<text class="coupon-size">{{ item.discount | moneyConduct }}</text>
<text class="font-size-tag coupon-sign">折</text>
<text class="font-size-tag coupon-sign">{{ $lang("common.register-reward.l60.t1") }}</text>
</view>
<view class="coupon-type font-size-tag">
<text :style="{ color: value.limitColor }">{{ item.at_least > 0 ? '满' +
Number(item.at_least) + '元可用' : '无门槛优惠券' }}</text>
<view class="item-text" v-if="item.goods_type == 1">所有商品可用</view>
<view class="item-text" v-else-if="item.goods_type == 2">指定商品可用</view>
<view class="item-text" v-else-if="item.goods_type == 3">指定商品不可用</view>
<text :style="{ color: value.limitColor }">{{ item.at_least > 0 ? $lang('diy.diy-coupon.l32.t0') +
Number(item.at_least) + '元可用' : $lang('diy.diy-coupon.l32.t2') }}</text>
<view class="item-text" v-if="item.goods_type == 1">{{ $lang("diy.diy-coupon.l103.t0") }}</view>
<view class="item-text" v-else-if="item.goods_type == 2">{{ $lang("diy.diy-coupon.l104.t0") }}</view>
<view class="item-text" v-else-if="item.goods_type == 3">{{ $lang("diy.diy-coupon.l105.t0") }}</view>
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="item.useState == 0">
{{ value.btnStyle.text || '领取' }}
{{ value.btnStyle.text || $lang('diy.diy-coupon.l71.t0') }}
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="parseInt(item.useState)">去使用</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="parseInt(item.useState)">{{ $lang("diy.diy-coupon.l38.t0") }}</view>
</view>
</swiper-item>
</swiper>
@@ -133,16 +133,16 @@
</view>
<view class="coupon-num" :style="{ color: value.moneyColor }" v-else>
<text class="coupon-size">{{ item.discount | moneyConduct }}</text>
<text class="font-size-tag coupon-sign">折</text>
<text class="font-size-tag coupon-sign">{{ $lang("common.register-reward.l60.t1") }}</text>
</view>
<view class="coupon-type font-size-tag" :style="{ color: value.limitColor }">
{{ item.at_least > 0 ? '满' + Number(item.at_least) + '元可用' : '无门槛优惠券' }}
{{ item.at_least > 0 ? $lang('diy.diy-coupon.l32.t0') + Number(item.at_least) + '元可用' : $lang('diy.diy-coupon.l32.t2') }}
</view>
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="item.useState == 0">
{{ value.btnStyle.text || '立即使用' }}
{{ value.btnStyle.text || $lang('diy.diy-coupon.l143.t0') }}
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="parseInt(item.useState)">去使用</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="parseInt(item.useState)">{{ $lang("diy.diy-coupon.l38.t0") }}</view>
</view>
</swiper-item>
</swiper>
@@ -160,11 +160,11 @@
<view class="coupon-num" v-if="item.discount == '0.00'"
:style="{ color: value.moneyColor }">
<text class="coupon-size">{{ item.money | moneyConduct }}</text>
<text class="font-size-tag coupon-sign">元</text>
<text class="font-size-tag coupon-sign">{{ $lang("common.register-reward.l45.t0") }}</text>
</view>
<view class="coupon-num" v-else :style="{ color: value.moneyColor }">
<text class="coupon-size">{{ item.discount | moneyConduct }}</text>
<text class="font-size-tag coupon-sign">折</text>
<text class="font-size-tag coupon-sign">{{ $lang("common.register-reward.l60.t1") }}</text>
</view>
</view>
<view class="coupon-line"></view>
@@ -173,12 +173,12 @@
<view class="coupon-name" :style="{ color: value.nameColor }">{{
item.coupon_name }}</view>
<text class="coupon-least" :style="{ color: value.limitColor }"
v-if="item.at_least > 0">满{{ Number(item.at_least) }}元可用</text>
v-if="item.at_least > 0">{ $lang("diy.diy-coupon.l32.t0") } Number(item.at_least) }}元可用</text>
<text class="coupon-least" :style="{ color: value.limitColor }"
v-else>无门槛优惠券</text>
v-else>{{ $lang("diy.diy-coupon.l32.t2") }}</text>
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="item.useState == 0">{{
value.btnStyle.text || '立即领取' }}</view>
value.btnStyle.text || $lang('diy.diy-coupon.l181.t0') }}</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="parseInt(item.useState)">
去使用</view>
</view>
@@ -204,9 +204,9 @@
<view class="price-wrap">
<text class="price" :style="{ color: value.moneyColor }">{{ (item.discount == '0.00'
? item.money : item.discount) | moneyConduct }}</text>
<text class="unit">{{ item.discount == '0.00' ? '元' : '折' }}</text>
<text class="unit">{{ item.discount == '0.00' ? '元' : $lang('common.register-reward.l60.t1') }}</text>
</view>
<text class="text">优惠券</text>
<text class="text">{{ $lang("diy.diy-coupon.l209.t0") }}</text>
</view>
<text class="btn" v-if="item.useState == 0" :style="{
color: value.btnStyle.textColor,
@@ -222,11 +222,11 @@
borderTopLeftRadius: value.btnStyle.aroundRadius * 2 + 'rpx',
borderBottomLeftRadius: value.btnStyle.aroundRadius * 2 + 'rpx'
}">
<text class="btn-content">去使用</text>
<text class="btn-content">{{ $lang("diy.diy-coupon.l38.t0") }}</text>
</text>
<text class="limit" :style="{ color: value.limitColor }"
v-if="parseFloat(item.at_least) > 0">满{{ item.at_least | moneyConduct }}元使用</text>
<text class="limit" :style="{ color: value.limitColor }" v-else>无门槛使用</text>
v-if="parseFloat(item.at_least) > 0">{ $lang("diy.diy-coupon.l32.t0") } item.at_least | moneyConduct }}元使用</text>
<text class="limit" :style="{ color: value.limitColor }" v-else>{{ $lang("diy.diy-coupon.l229.t0") }}</text>
</view>
<div v-if="computedCouponList.length <= 2" @tap.stop="$util.redirectTo('/pages_goods/category')"
@@ -238,9 +238,9 @@
}">
<div class="coupon-content" :style="{ color: value.moneyColor }">
<span class="price">+</span>
<span class="text">暂无优惠券</span>
<span class="text">{{ $lang("diy.diy-coupon.l241.t0") }}</span>
</div>
<span class="limit" :style="{ color: value.limitColor }">去逛逛</span>
<span class="limit" :style="{ color: value.limitColor }">{{ $lang("common.ns-empty.l31.t0") }}</span>
</div>
</swiper-item>
</swiper>
@@ -257,23 +257,23 @@
<view class="coupon-num" v-if="item.discount == '0.00'"
:style="{ color: value.moneyColor }">
<text class="coupon-size">{{ item.money | moneyConduct }}</text>
<text class="font-size-tag coupon-sign">元</text>
<text class="font-size-tag coupon-sign">{{ $lang("common.register-reward.l45.t0") }}</text>
</view>
<view class="coupon-num" v-else :style="{ color: value.moneyColor }">
<text class="coupon-size">{{ item.discount | moneyConduct }}</text>
<text class="font-size-tag coupon-sign">折</text>
<text class="font-size-tag coupon-sign">{{ $lang("common.register-reward.l60.t1") }}</text>
</view>
</view>
<view class="coupon-type">
<text class="coupon-name" :style="{ color: value.limitColor }"
v-if="item.at_least > 0">满{{ Number(item.at_least) }}元可用</text>
<text class="coupon-name" :style="{ color: value.limitColor }" v-else>无门槛优惠券</text>
v-if="item.at_least > 0">{ $lang("diy.diy-coupon.l32.t0") } Number(item.at_least) }}元可用</text>
<text class="coupon-name" :style="{ color: value.limitColor }" v-else>{{ $lang("diy.diy-coupon.l32.t2") }}</text>
<view class="coupon-least" :style="{ color: value.limitColor }">有效期至{{
$util.timeStampTurnTime(item.end_time, 'yearmonthday') }}</view>
</view>
<view class="coupon-line"></view>
<view class="coupon-get" :style="couponBtnStyle" v-if="item.useState == 0">
{{ value.btnStyle.text || '立即领取' }}
{{ value.btnStyle.text || $lang('diy.diy-coupon.l181.t0') }}
</view>
<view class="coupon-get" :style="couponBtnStyle" v-if="parseInt(item.useState)">去使用
</view>
@@ -404,7 +404,7 @@ export default {
couponTap(item, index) {
if (item.count == item.lead_count) {
this.$util.showToast({
title: '该优惠券已抢光'
title: $lang('diy.diy-coupon.l407.t0')
});
return;
}
@@ -427,7 +427,7 @@ export default {
var data = res.data;
let msg = res.message;
if (res.code == 0) {
msg = '领取成功';
msg = $lang('diy.diy-coupon.l430.t0');
if (res.data.is_exist == 1) {
for (let i = 0; i < that.couponList.length; i++) {
if (that.couponList[i].coupon_type_id == item.coupon_type_id) {