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

@@ -3,7 +3,7 @@
<!-- 搜索入口按钮(浮动在消息区右上角) -->
<view class="search-entrance" :class="{ 'icon-only': !showLabel }" v-if="!showSearchBar" @click="toggleSearch">
<text class="iconfont icon-sousuo search-entrance-icon"></text>
<text class="search-entrance-label" v-if="showLabel">{{ $lang('searchEntrance') }}</text>
<text class="search-entrance-label" v-if="showLabel">{{ $lang('ai-chat.index.searchEntrance') }}</text>
</view>
<!-- 搜索浮条 -->
@@ -14,7 +14,7 @@
<input
class="search-bar-input"
v-model="searchKeyword"
:placeholder="$lang('searchPlaceholder')"
:placeholder="$lang('ai-chat.index.searchPlaceholder')"
:focus="true"
@input="onSearchInput"
@confirm="doSearch" />
@@ -27,11 +27,11 @@
<text class="search-bar-nav" :class="{ disabled: searchResultIndex >= searchResults.length - 1 }" @click="scrollToNextResult">▼</text>
</view>
</view>
<text class="search-bar-close" @click="closeSearch">{{ $lang('searchClose') }}</text>
<text class="search-bar-close" @click="closeSearch">{{ $lang('ai-chat.index.searchClose') }}</text>
</view>
<view class="search-bar-status" v-if="searched && searchKeyword && searchResults.length === 0">
<text class="search-bar-status-icon">!</text>
<text class="search-bar-status-text">{{ $lang('noMatchResult') }}</text>
<text class="search-bar-status-text">{{ $lang('ai-chat.index.noMatchResult') }}</text>
</view>
</view>
</view>
@@ -187,7 +187,7 @@ export default {
if (idx >= 0) {
this.scrollToSearchResult(idx)
} else {
uni.showToast({ title: this.$lang('searchAtTop'), icon: 'none' })
uni.showToast({ title: this.$lang('ai-chat.index.searchAtTop'), icon: 'none' })
}
},
@@ -196,7 +196,7 @@ export default {
if (idx < this.searchResults.length) {
this.scrollToSearchResult(idx)
} else {
uni.showToast({ title: this.$lang('searchAtBottom'), icon: 'none' })
uni.showToast({ title: this.$lang('ai-chat.index.searchAtBottom'), icon: 'none' })
}
},