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:
@@ -3,7 +3,7 @@
|
||||
<view class="avatar-selector-mask" @click="close"></view>
|
||||
<view class="avatar-selector-panel">
|
||||
<view class="avatar-selector-header">
|
||||
<text>{{ $lang('avatarSelectorTitle') }}</text>
|
||||
<text>{{ $lang('ai-chat.index.avatarSelectorTitle') }}</text>
|
||||
<button class="close-btn" @click="close">
|
||||
<text class="iconfont icon-close"></text>
|
||||
</button>
|
||||
@@ -15,10 +15,10 @@
|
||||
<view class="avatar-selector-actions">
|
||||
<button class="avatar-select-action" @click="chooseAvatarFromAlbum">
|
||||
<text class="iconfont icon-album"></text>
|
||||
<text>{{ $lang('chooseFromAlbum') }}</text>
|
||||
<text>{{ $lang('ai-chat.index.chooseFromAlbum') }}</text>
|
||||
</button>
|
||||
<button class="avatar-select-action cancel" @click="close">
|
||||
<text>{{ $lang('cancel') }}</text>
|
||||
<text>{{ $lang('ai-chat.index.cancel') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
reader.readAsDataURL(file)
|
||||
this.$emit('avatar-change', tempFilePath)
|
||||
this.close()
|
||||
uni.showToast({ title: this.$lang('avatarChangeSuccess'), icon: 'success', duration: 1500 })
|
||||
uni.showToast({ title: this.$lang('ai-chat.index.avatarChangeSuccess'), icon: 'success', duration: 1500 })
|
||||
} else {
|
||||
this.close()
|
||||
}
|
||||
@@ -99,11 +99,11 @@ export default {
|
||||
uni.setStorageSync('user_avatar', tempFilePath)
|
||||
this.$emit('avatar-change', tempFilePath)
|
||||
this.close()
|
||||
uni.showToast({ title: this.$lang('avatarChangeSuccess'), icon: 'success', duration: 1500 })
|
||||
uni.showToast({ title: this.$lang('ai-chat.index.avatarChangeSuccess'), icon: 'success', duration: 1500 })
|
||||
},
|
||||
fail: (error) => {
|
||||
if (error.errMsg && error.errMsg.includes('deny')) {
|
||||
uni.showToast({ title: this.$lang('enableAlbumPermission'), icon: 'none', duration: 2000 })
|
||||
uni.showToast({ title: this.$lang('ai-chat.index.enableAlbumPermission'), icon: 'none', duration: 2000 })
|
||||
}
|
||||
this.close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user