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

@@ -37,12 +37,12 @@
<view class="goods-module-wrap">
<text class="price-symbol ">{{ pointInfo.point }}积分</text>
<template v-if="pointInfo.exchange_price != '0.00' && pointInfo.pay_type > 0">
<text class="price-symbol ">+{{ $lang('common.currencySymbol') }}{{ pointInfo.exchange_price
<text class="price-symbol ">+{{ $lang('common.currency_symbol') }}{{ pointInfo.exchange_price
}}</text>
</template>
<view class="market-price-wrap" v-if="pointInfo.price">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
<text class="unit">{{ $lang('common.currency_symbol') }}</text>
<text class="money">{{ pointInfo.price }}</text>
</view>
@@ -63,9 +63,9 @@
<view class="coupon-desc">
<view v-if="pointInfo.balance && pointInfo.balance > 0" class="color-tip">内含{{ pointInfo.balance
}}元</view>
<view v-if="pointInfo.coupon_type == 'random'" class="color-tip">无门槛优惠券</view>
<view v-if="pointInfo.coupon_type == 'random'" class="color-tip">{{ $lang("diy.diy-coupon.l32.t2") }}</view>
<view v-if="pointInfo.coupon_type == 'reward'" class="color-tip">{{ '满' + pointInfo.at_least +
'减' + pointInfo.money
$lang('common.register-reward.l60.t2') + pointInfo.money
}}</view>
<view v-if="pointInfo.coupon_type == 'discount'" class="color-tip">
满{{ pointInfo.at_least }}元
@@ -74,8 +74,8 @@
<view v-if="pointInfo.coupon_type == 'discount'" class="color-tip">最多优惠{{
pointInfo.discount_limit }}元</view>
<view class="time color-tip" v-if="pointInfo.coupon_type">
{{ pointInfo.validity_type == 1 ? '领取之日起' + pointInfo.fixed_term + '天内有效' :
$util.timeStampTurnTime(pointInfo.end_time) + '到期' }}
{{ pointInfo.validity_type == 1 ? $lang('point.detail.l77') + pointInfo.fixed_term + '天内有效' :
$util.timeStampTurnTime(pointInfo.end_time) + $lang('point.detail.l78') }}
</view>
</view>
</view>
@@ -88,7 +88,7 @@
<view class="community-txt">{{ pointInfo.qr_data.community_describe }}</view>
</view>
</view>
<view class="community-btn" @click="onCommunity()">添加</view>
<view class="community-btn" @click="onCommunity()">{{ $lang("goods._components.goods-detail-view.l257.t0") }}</view>
</view>
<!-- 促销 -->
@@ -96,7 +96,7 @@
v-show="isCommunity">
<view class="community-model-content" @click.stop>
<view class="community-model-content-radius">
<view>添加社群</view>
<view>{{ $lang("goods._components.goods-detail-view.l264.t0") }}</view>
</view>
<view class="community-model-content-draw" v-if="pointInfo.qr_data && pointInfo.qr_data.qr_img">
<image :src="pointInfo.qr_data.qr_img != '' && pointInfo.qr_data.qr_state == 1
@@ -104,7 +104,7 @@
: $util.img('public/uniapp/goods/detail_erweiImage.png')
" mode="aspectFill" show-menu-by-longpress />
</view>
<view class="community-model-content-text">长按识别二维码,添加社群</view>
<view class="community-model-content-text">{{ $lang("goods._components.goods-detail-view.l269.t0") }}</view>
</view>
<view class="community-model-close" @click.stop="onCloseCommunity()"><text
class="iconfont icon-close"></text>
@@ -115,7 +115,7 @@
<view class="newdetail margin-bottom">
<!-- 已选规格 -->
<view class="item selected-sku-spec" v-if="pointInfo.sku_spec_format" @click="exchange">
<view class="label">选择</view>
<view class="label">{{ $lang("goods.detail.l187") }}</view>
<view class="box">
<text v-for="(item, index) in pointInfo.sku_spec_format" :key="index">{{ item.spec_name
}}/{{
@@ -126,7 +126,7 @@
<view class="item goods-attribute" @click="openAttributePopup()"
v-if="pointInfo.goods_attr_format && pointInfo.goods_attr_format.length > 0">
<view class="label">属性</view>
<view class="label">{{ $lang("point.detail.l129") }}</view>
<view class="box">
<text v-for="(item, index) in pointInfo.goods_attr_format" :key="index"
v-if="index < 2">{{
@@ -141,7 +141,7 @@
<uni-popup ref="attributePopup" type="bottom">
<view class="goods-attribute-popup-layer popup-layer">
<view class="head-wrap" @click="closeAttributePopup()">
<text>商品属性</text>
<text>{{ $lang("point.detail.l144") }}</text>
<text class="iconfont icon-close"></text>
</view>
<scroll-view scroll-y class="goods-attribute-body">
@@ -152,7 +152,7 @@
</view>
</scroll-view>
<view class="button-box"><button type="primary"
@click="closeAttributePopup()">确定</button></view>
@click="closeAttributePopup()">{{ $lang("common.ns-goods-sku.ns-goods-sku-category.l76.t0") }}</button></view>
</view>
</uni-popup>
</view>
@@ -161,7 +161,7 @@
<uni-popup ref="merchantsServicePopup" type="bottom">
<view class="goods-merchants-service-popup-layer popup-layer">
<view class="head-wrap" @click="closeMerchantsServicePopup()">
<text>商品服务</text>
<text>{{ $lang("goods._components.goods-detail-view.l180.t0") }}</text>
<text class="iconfont icon-close"></text>
</view>
<scroll-view scroll-y>
@@ -175,7 +175,7 @@
</view>
</scroll-view>
<view class="button-box"><button type="primary"
@click="closeMerchantsServicePopup()">确定</button></view>
@click="closeMerchantsServicePopup()">{{ $lang("common.ns-goods-sku.ns-goods-sku-category.l76.t0") }}</button></view>
</view>
</uni-popup>
</view>
@@ -184,7 +184,7 @@
<!-- 详情 -->
<view class="goods-detail-tab">
<view class="detail-tab">
<view class="tab-item">兑换详情</view>
<view class="tab-item">{{ $lang("point.detail.l187") }}</view>
</view>
<view class="detail-content">
@@ -192,7 +192,7 @@
<view class="goods-details" v-if="pointInfo.content"><rich-text
:nodes="pointInfo.content"></rich-text>
</view>
<view class="goods-details active" v-else>暂无兑换详情!</view>
<view class="goods-details active" v-else>{{ $lang("point.detail.l195") }}</view>
</view>
</view>
</view>
@@ -205,14 +205,14 @@
</view>
<view class="detail-swap" @click="exchange()" :class="{ 'position-bottom': isIphoneX }" v-if="!isLogin"><button
type="primary">登录之后方可兑换</button></view>
type="primary">{{ $lang("point.detail.l208") }}</button></view>
<block v-else>
<view class="detail-swap" :class="{ 'position-bottom': isIphoneX }" v-if="pointInfo.stock == 0"><button
disabled>库存不足</button></view>
disabled>{{ $lang("common.ns-goods-sku.ns-goods-sku-category.l264.t0") }}</button></view>
<view class="detail-swap" :class="{ 'position-bottom': isIphoneX }" v-else-if="enough"><button
disabled>积分不足</button></view>
disabled>{{ $lang("point.detail.l213") }}</button></view>
<view class="detail-swap" @click="exchange()" :class="{ 'position-bottom': isIphoneX }" v-else><button
type="primary" hover-class="none">兑换</button></view>
type="primary" hover-class="none">{{ $lang("common.ns-goods-sku.l185.t0") }}</button></view>
</block>
<loading-cover ref="loadingCover"></loading-cover>
@@ -293,7 +293,7 @@ export default {
imageUrl = this.pointInfo.image;
break;
}
title = '仅需' + this.pointInfo.point + '积分即可兑换' + title;
title = $lang('point.detail.l296') + this.pointInfo.point + $lang('point.detail.l296') + title;
imageUrl = this.$util.img(imageUrl);
var route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
var path = route.path;
@@ -322,7 +322,7 @@ export default {
imageUrl = this.pointInfo.image;
break;
}
title = '仅需' + this.pointInfo.point + '积分即可兑换' + title;
title = $lang('point.detail.l296') + this.pointInfo.point + $lang('point.detail.l296') + title;
imageUrl = this.$util.img(imageUrl);
var route = this.$util.getCurrentShareRoute(this.memberInfo ? this.memberInfo.member_id : 0);
var query = route.query;
@@ -424,7 +424,7 @@ export default {
if (this.pointInfo.goods_spec_format) this.pointInfo.goods_spec_format = JSON.parse(this.pointInfo.goods_spec_format);
}
this.pointInfo.unit = this.pointInfo.unit || '件';
this.pointInfo.unit = this.pointInfo.unit || $lang('common.ns-goods-sku.ns-goods-sku-index.l150.t0');
// 商品详情
if (this.pointInfo.content) this.pointInfo.content = htmlParser(this.pointInfo.content);
@@ -458,7 +458,7 @@ export default {
*/
refreshGoodsSkuDetail(pointInfo) {
Object.assign(this.pointInfo, pointInfo);
this.pointInfo.unit = this.pointInfo.unit || '件';
this.pointInfo.unit = this.pointInfo.unit || $lang('common.ns-goods-sku.ns-goods-sku-index.l150.t0');
},
//服务
openMerchantsServicePopup() {