ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

DatePicker 组件中文本地化不完整,部分内容仍显示英文

Open setube opened this issue 5 months ago • 0 comments
trafficstars

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

  • Vue 3.2.47
  • Node.js 16.14.0
  • 操作系统:Windows 10

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. 创建一个新的 Vue 组件
  2. 引入 DatePicker 组件和中文语言包:
import { DatePicker } from 'ant-design-vue'
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN'
  1. 在模板中使用 DatePicker 组件:
<template>
<a-range-picker v-model:value="dateRange" :locale="locale" />
</template>

What is expected?

DatePicker 组件应该完全显示中文,包括:

  • 月份名称(一月、二月等)
  • 星期名称(星期一、星期二等)
  • 日期格式(YYYY年MM月DD日)
  • 快捷选项(今天、本周、本月等)
  • 按钮文本(确定、取消等)

What is actually happening?

只有部分内容显示为中文,其他内容仍显示为英文:

  • 月份名称显示为英文(January、February等)
  • 星期名称显示为英文(Monday、Tuesday等)
  • 日期格式显示为英文(YYYY-MM-DD)
  • 快捷选项部分显示为英文
  • 按钮文本显示为英文(OK、Cancel)

这个问题在业务场景中影响了用户体验,特别是在需要完全中文化的管理后台系统中。虽然设置了 :locale="locale" 属性,但本地化效果不完整,导致界面语言不统一。

建议检查 locale 配置是否完整,或者考虑在文档中明确说明当前版本的中文本地化支持程度。

setube avatar May 31 '25 12:05 setube