refactor: 统一多语言key的组件命名格式为短横线分隔
根据i18n规范,将所有组件相关的多语言key从驼峰式改为短横线分隔格式,同步更新文档中的示例说明。
This commit is contained in:
@@ -29,10 +29,10 @@
|
||||
|
||||
| 行 | 错误调用 | 语言包实际 key | 说明 |
|
||||
|---|---|---|---|
|
||||
| 93 | `$lang('components-diy.diy-article.viewMore')` | `components-diy.diyArticle.viewMore` | 组件名大小写不一致,`normalizeSharedLangPack` 将 `diy-article` 转为 `diyArticle` |
|
||||
| 98 | `$lang('components-diy.diy-article.noArticles')` | `components-diy.diyArticle.noArticles` | 同上 |
|
||||
| 93 | `$lang('components-diy.diy-article.viewMore')` | `components-diy.diy-article.viewMore` | 组件名大小写不一致,`normalizeSharedLangPack` 将 `diy-article` 转为 `diyArticle` |
|
||||
| 98 | `$lang('components-diy.diy-article.noArticles')` | `components-diy.diy-article.noArticles` | 同上 |
|
||||
|
||||
**修复建议**:统一改为 `$lang('components-diy.diyArticle.viewMore')` / `$lang('components-diy.diyArticle.noArticles')`。
|
||||
**修复建议**:统一改为 `$lang('components-diy.diy-article.viewMore')` / `$lang('components-diy.diy-article.noArticles')`。
|
||||
|
||||
### 2. `pages_promotion/point/goods_list.vue`
|
||||
|
||||
@@ -74,32 +74,32 @@
|
||||
|
||||
| 文件 | 行 | 中文文本 | 建议 key |
|
||||
|---|---|---|---|
|
||||
| `components/chat-message/chat-message.vue` | 60 | 客服不在线 | `components.chatMessage.customerOffline` |
|
||||
| `components/chat-message/chat-message.vue` | 63 | 客服在线 | `components.chatMessage.customerOnline` |
|
||||
| `components/pick-regions/pick-regions.vue` | 17 | 取消 | `components.pickRegions.cancel` |
|
||||
| `components/pick-regions/pick-regions.vue` | 18 | 完成 | `components.pickRegions.confirm` |
|
||||
| `components/ns-goods-sku/ns-goods-sku.vue` | 22 | `{point}积分` | `components.goodsSku.pointSuffix`(使用命名参数) |
|
||||
| `components/ns-chat/ns-chat-receiveGoods.vue` | 8 | 库存: | `components.chatReceiveGoods.stockPrefix` |
|
||||
| `components/ns-chat/ns-chat-receiveGoods.vue` | 9 | 销量: | `components.chatReceiveGoods.salesPrefix` |
|
||||
| `components/ns-chat/ns-chat-receiveGoods.vue` | 17 | 查看商品 | `components.chatReceiveGoods.viewGoods` |
|
||||
| `components/ns-chat/ns-chat-goods.vue` | 12 | 已发送 | `components.chatGoods.sent` |
|
||||
| `components/ns-chat/ns-chat-goods.vue` | 25 | 发送 | `components.chatGoods.send` |
|
||||
| `components/ns-video-player-popup/ns-video-player-popup.vue` | 17 | 视频地址不存在 | `components.videoPlayerPopup.videoUrlNotExist` |
|
||||
| `components/chat-message/chat-message.vue` | 60 | 客服不在线 | `components.chat-message.customerOffline` |
|
||||
| `components/chat-message/chat-message.vue` | 63 | 客服在线 | `components.chat-message.customerOnline` |
|
||||
| `components/pick-regions/pick-regions.vue` | 17 | 取消 | `components.pick-regions.cancel` |
|
||||
| `components/pick-regions/pick-regions.vue` | 18 | 完成 | `components.pick-regions.confirm` |
|
||||
| `components/ns-goods-sku/ns-goods-sku.vue` | 22 | `{point}积分` | `components.ns-goods-sku.pointSuffix`(使用命名参数) |
|
||||
| `components/ns-chat/ns-chat-receiveGoods.vue` | 8 | 库存: | `components.ns-chat-receiveGoods.stockPrefix` |
|
||||
| `components/ns-chat/ns-chat-receiveGoods.vue` | 9 | 销量: | `components.ns-chat-receiveGoods.salesPrefix` |
|
||||
| `components/ns-chat/ns-chat-receiveGoods.vue` | 17 | 查看商品 | `components.ns-chat-receiveGoods.viewGoods` |
|
||||
| `components/ns-chat/ns-chat-goods.vue` | 12 | 已发送 | `components.ns-chat-goods.sent` |
|
||||
| `components/ns-chat/ns-chat-goods.vue` | 25 | 发送 | `components.ns-chat-goods.send` |
|
||||
| `components/ns-video-player-popup/ns-video-player-popup.vue` | 17 | 视频地址不存在 | `components.ns-video-player-popup.videoUrlNotExist` |
|
||||
|
||||
### 3.2 装修组件(`components-diy/`)
|
||||
|
||||
| 文件 | 行 | 中文文本 | 建议 key |
|
||||
|---|---|---|---|
|
||||
| `components-diy/diy-search.vue` | 31 | 搜索 | `components-diy.diySearch.searchBtn` |
|
||||
| `components-diy/diy-map.vue` | 16 | 一键导航 | `components-diy.diyMap.navigate` |
|
||||
| `components-diy/diy-kefu.vue` | 17 | 立即添加 | `components-diy.diyKefu.addNow` |
|
||||
| `components-diy/diy-channel-video.vue` | 20, 32, 40 | `{count}次观看` | `components-diy.diyChannelVideo.viewCountSuffix`(使用命名参数) |
|
||||
| `components-diy/diy-live.vue` | 29 | 主播: | `components-diy.diyLive.anchorPrefix` |
|
||||
| `components-diy/diy-live.vue` | 33 | 直播商品: | `components-diy.diyLive.goodsPrefix` |
|
||||
| `components-diy/diy-listmenu.vue` | 15 | 查看 | `components-diy.diyListMenu.view` |
|
||||
| `components-diy/diy-text.vue` | 211 | 专区 | `components-diy.diyText.zone` |
|
||||
| `components-diy/diy-goods-recommend.vue` | 56 | 售 / 件 | `components-diy.diyGoodsRecommend.soldPrefix` / `unit.piece` |
|
||||
| `components-diy/diy-notes.vue` | 42 | 阅读 | `components-diy.diyNotes.readPrefix` |
|
||||
| `components-diy/diy-search.vue` | 31 | 搜索 | `components-diy.diy-search.searchBtn` |
|
||||
| `components-diy/diy-map.vue` | 16 | 一键导航 | `components-diy.diy-map.navigate` |
|
||||
| `components-diy/diy-kefu.vue` | 17 | 立即添加 | `components-diy.diy-kefu.addNow` |
|
||||
| `components-diy/diy-channel-video.vue` | 20, 32, 40 | `{count}次观看` | `components-diy.diy-channel-video.viewCountSuffix`(使用命名参数) |
|
||||
| `components-diy/diy-live.vue` | 29 | 主播: | `components-diy.diy-live.anchorPrefix` |
|
||||
| `components-diy/diy-live.vue` | 33 | 直播商品: | `components-diy.diy-live.goodsPrefix` |
|
||||
| `components-diy/diy-listmenu.vue` | 15 | 查看 | `components-diy.diy-listmenu.view` |
|
||||
| `components-diy/diy-text.vue` | 211 | 专区 | `components-diy.diy-text.zone` |
|
||||
| `components-diy/diy-goods-recommend.vue` | 56 | 售 / 件 | `components-diy.diy-goods-recommend.soldPrefix` / `unit.piece` |
|
||||
| `components-diy/diy-notes.vue` | 42 | 阅读 | `components-diy.diy-notes.readPrefix` |
|
||||
|
||||
### 3.3 页面级(`pages_tool/`、`pages_promotion/`)
|
||||
|
||||
@@ -208,8 +208,8 @@
|
||||
|
||||
| 文件 | 问题 | 修正 |
|
||||
|---|---|---|
|
||||
| `components-diy/diy-listmenu.vue` | 调用 `components-diy.diyListMenu.view`,但 `normalizeSharedLangPack` 生成的命名空间为 `diyListmenu`(小写 m) | 改为 `components-diy.diyListmenu.view` |
|
||||
| `lang/zh-cn/components/ns-goods-sku.js`、`lang/en-us/components/ns-goods-sku.js` | 语言包使用 `components.goodsSku.pointSuffix`,与文件路径 `components/ns-goods-sku` 生成的 `components.nsGoodsSku` 不一致 | 改为 `components.nsGoodsSku.pointSuffix` |
|
||||
| `components-diy/diy-listmenu.vue` | 调用 `components-diy.diy-listmenu.view`,但 `normalizeSharedLangPack` 生成的命名空间为 `diyListmenu`(小写 m) | 改为 `components-diy.diy-listmenu.view` |
|
||||
| `lang/zh-cn/components/ns-goods-sku.js`、`lang/en-us/components/ns-goods-sku.js` | 语言包使用 `components.ns-goods-sku.pointSuffix`,与文件路径 `components/ns-goods-sku` 生成的 `components.nsGoodsSku` 不一致 | 改为 `components.ns-goods-sku.pointSuffix` |
|
||||
| `lang/zh-cn/notice/list.js`、`lang/en-us/notice/list.js` | 包内存在嵌套 `notice: { ... }`,导致完整命名空间 `notice.list.topTag` 无法解析 | 拍平为扁平结构 |
|
||||
| `lang/zh-cn/notice/detail.js`、`lang/en-us/notice/detail.js` | 同上,嵌套 `notice` 对象 | 拍平为扁平结构 |
|
||||
| `lang/zh-cn/help/list.js`、`lang/en-us/help/list.js` | 同上,嵌套 `help` 对象 | 拍平为扁平结构 |
|
||||
|
||||
@@ -104,7 +104,7 @@ export const lang = {
|
||||
调用方式:
|
||||
|
||||
```vue
|
||||
{{ $lang('components-diy.diyArticle.viewMore') }}
|
||||
{{ $lang('components-diy.diy-article.viewMore') }}
|
||||
```
|
||||
|
||||
> 注意:组件名 `diy-article` 归一化后为 `diyArticle`,不是 `diy-article`,也不是 `diyArticle` 以外的任何形式。若语言包本身已按 `{ componentsDiy: { diyArticle: {...} } }` 嵌套,则直接透传,不再二次包装。
|
||||
|
||||
Reference in New Issue
Block a user