diff --git a/src/_common b/src/_common index 4bdf9ced2d..addb5d0994 160000 --- a/src/_common +++ b/src/_common @@ -1 +1 @@ -Subproject commit 4bdf9ced2d0b1c3aaf88c035424ef2230d71f396 +Subproject commit addb5d0994274db18d129c1809bd34eeeb789299 diff --git a/src/color-picker/components/panel/header.tsx b/src/color-picker/components/panel/header.tsx index f2fef6ceeb..e7c93de067 100644 --- a/src/color-picker/components/panel/header.tsx +++ b/src/color-picker/components/panel/header.tsx @@ -3,6 +3,7 @@ import { COLOR_MODES } from '../../const'; import Radio, { RadioValue } from '../../../radio'; import { TdColorModes } from '../../interface'; import { TdColorPickerProps } from '../../type'; +import { useLocaleReceiver } from '../../../locale/LocalReceiver'; export interface ColorPanelHeaderProps extends TdColorPickerProps { mode?: TdColorModes; @@ -12,6 +13,8 @@ export interface ColorPanelHeaderProps extends TdColorPickerProps { } const Header = (props: ColorPanelHeaderProps) => { + const [local, t] = useLocaleReceiver('colorPicker'); + const { baseClassName, mode = 'monochrome', colorModes, onModeChange } = props; const isSingleMode = colorModes?.length === 1; @@ -23,17 +26,13 @@ const Header = (props: ColorPanelHeaderProps) => { return (
- {colorModes?.length === 1 ? ( - COLOR_MODES[colorModes[0]] - ) : ( - - {Object.keys(COLOR_MODES).map((key) => ( - - {COLOR_MODES[key]} - - ))} - - )} + + {Object.keys(COLOR_MODES).map((key) => ( + + {t(local[COLOR_MODES[key]])} + + ))} +
); diff --git a/src/color-picker/const.ts b/src/color-picker/const.ts index 615deabb62..f557f15c9d 100644 --- a/src/color-picker/const.ts +++ b/src/color-picker/const.ts @@ -7,8 +7,8 @@ export const TD_COLOR_USED_COLORS_MAX_SIZE = 100; // 每行10个 // 颜色模式options配置 export const COLOR_MODES = { - monochrome: '单色', - 'linear-gradient': '渐变', + monochrome: 'singleColor', + 'linear-gradient': 'gradientColor', }; // 非透明色格式化类型