mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
feat: Define PickerLocale typedef (#22132)
This commit is contained in:
parent
bf7f47a7d7
commit
875f1afc79
@ -13,7 +13,7 @@ import {
|
||||
RangePickerDateProps as RCRangePickerDateProps,
|
||||
RangePickerTimeProps as RCRangePickerTimeProps,
|
||||
} from 'rc-picker/lib/RangePicker';
|
||||
import { PickerMode } from 'rc-picker/lib/interface';
|
||||
import { PickerMode, Locale as RcPickerLocale } from 'rc-picker/lib/interface';
|
||||
import CalendarOutlined from '@ant-design/icons/CalendarOutlined';
|
||||
import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined';
|
||||
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
|
||||
@ -24,6 +24,7 @@ import { getPlaceholder, getRangePlaceholder } from './util';
|
||||
import PickerButton from './PickerButton';
|
||||
import PickerTag from './PickerTag';
|
||||
import SizeContext, { SizeType } from '../config-provider/SizeContext';
|
||||
import { TimePickerLocale } from '../time-picker';
|
||||
|
||||
const Components = { button: PickerButton, rangeItem: PickerTag };
|
||||
|
||||
@ -78,11 +79,34 @@ type InjectDefaultProps<Props> = Omit<
|
||||
| 'hideHeader'
|
||||
| 'components'
|
||||
> & {
|
||||
locale?: typeof enUS;
|
||||
locale?: PickerLocale;
|
||||
size?: SizeType;
|
||||
bordered?: boolean;
|
||||
};
|
||||
|
||||
export type PickerLocale = {
|
||||
lang: RcPickerLocale & AdditionalPickerLocaleLangProps;
|
||||
timePickerLocale: TimePickerLocale;
|
||||
} & AdditionalPickerLocaleProps;
|
||||
|
||||
export type AdditionalPickerLocaleProps = {
|
||||
dateFormat?: string;
|
||||
dateTimeFormat?: string;
|
||||
weekFormat?: string;
|
||||
monthFormat?: string;
|
||||
};
|
||||
|
||||
export type AdditionalPickerLocaleLangProps = {
|
||||
placeholder: string;
|
||||
yearPlaceholder?: string;
|
||||
monthPlaceholder?: string;
|
||||
weekPlaceholder?: string;
|
||||
rangeYearPlaceholder?: [string, string];
|
||||
rangeMonthPlaceholder?: [string, string];
|
||||
rangeWeekPlaceholder?: [string, string];
|
||||
rangePlaceholder?: [string, string];
|
||||
};
|
||||
|
||||
// Picker Props
|
||||
export type PickerBaseProps<DateType> = InjectDefaultProps<RCPickerBaseProps<DateType>>;
|
||||
export type PickerDateProps<DateType> = InjectDefaultProps<RCPickerDateProps<DateType>>;
|
||||
@ -140,12 +164,12 @@ function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
||||
};
|
||||
result.lang = {
|
||||
...result.lang,
|
||||
...((locale || {}) as any).lang,
|
||||
...((locale || {}) as PickerLocale).lang,
|
||||
};
|
||||
return result;
|
||||
};
|
||||
|
||||
renderPicker = (locale: any) => {
|
||||
renderPicker = (locale: PickerLocale) => {
|
||||
const { getPrefixCls, direction } = this.context;
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
@ -263,12 +287,12 @@ function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
||||
};
|
||||
result.lang = {
|
||||
...result.lang,
|
||||
...((locale || {}) as any).lang,
|
||||
...((locale || {}) as PickerLocale).lang,
|
||||
};
|
||||
return result;
|
||||
};
|
||||
|
||||
renderPicker = (locale: any) => {
|
||||
renderPicker = (locale: PickerLocale) => {
|
||||
const { getPrefixCls, direction } = this.context;
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ar_EG';
|
||||
import TimePickerLocale from '../../time-picker/locale/ar_EG';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'اختيار التاريخ',
|
||||
rangePlaceholder: ['البداية', 'النهاية'],
|
||||
|
@ -1,7 +1,8 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/az_AZ';
|
||||
import TimePickerLocale from '../../time-picker/locale/az_AZ';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Tarix seçin',
|
||||
rangePlaceholder: ['Başlama tarixi', 'Bitmə tarixi'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/bg_BG';
|
||||
import TimePickerLocale from '../../time-picker/locale/bg_BG';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Избор на дата',
|
||||
rangePlaceholder: ['Начална', 'Крайна'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ca_ES';
|
||||
import TimePickerLocale from '../../time-picker/locale/ca_ES';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Seleccionar data',
|
||||
rangePlaceholder: ['Data inicial', 'Data final'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/cs_CZ';
|
||||
import TimePickerLocale from '../../time-picker/locale/cs_CZ';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Vybrat datum',
|
||||
rangePlaceholder: ['Od', 'Do'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/da_DK';
|
||||
import TimePickerLocale from '../../time-picker/locale/da_DK';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Vælg dato',
|
||||
rangePlaceholder: ['Startdato', 'Slutdato'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/de_DE';
|
||||
import TimePickerLocale from '../../time-picker/locale/de_DE';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Datum auswählen',
|
||||
rangePlaceholder: ['Startdatum', 'Enddatum'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/el_GR';
|
||||
import TimePickerLocale from '../../time-picker/locale/el_GR';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Επιλέξτε ημερομηνία',
|
||||
rangePlaceholder: ['Αρχική ημερομηνία', 'Τελική ημερομηνία'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/en_GB';
|
||||
import TimePickerLocale from '../../time-picker/locale/en_GB';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Select date',
|
||||
rangePlaceholder: ['Start date', 'End date'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/en_US';
|
||||
import TimePickerLocale from '../../time-picker/locale/en_US';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Select date',
|
||||
yearPlaceholder: 'Select year',
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/es_ES';
|
||||
import TimePickerLocale from '../../time-picker/locale/es_ES';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Seleccionar fecha',
|
||||
rangePlaceholder: ['Fecha inicial', 'Fecha final'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/et_EE';
|
||||
import TimePickerLocale from '../../time-picker/locale/et_EE';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// 统一合并为完整的 Locale
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Vali kuupäev',
|
||||
rangePlaceholder: ['Algus kuupäev', 'Lõpu kuupäev'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/fa_IR';
|
||||
import TimePickerLocale from '../../time-picker/locale/fa_IR';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'انتخاب تاریخ',
|
||||
rangePlaceholder: ['تاریخ شروع', 'تاریخ پایان'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/fi_FI';
|
||||
import TimePickerLocale from '../../time-picker/locale/fi_FI';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Valitse päivä',
|
||||
rangePlaceholder: ['Alku päivä', 'Loppu päivä'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/fr_BE';
|
||||
import TimePickerLocale from '../../time-picker/locale/fr_BE';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Sélectionner une date',
|
||||
rangePlaceholder: ['Date de début', 'Date de fin'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/fr_FR';
|
||||
import TimePickerLocale from '../../time-picker/locale/fr_FR';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Sélectionner une date',
|
||||
rangePlaceholder: ['Date de début', 'Date de fin'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/he_IL';
|
||||
import TimePickerLocale from '../../time-picker/locale/he_IL';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'בחר תאריך',
|
||||
rangePlaceholder: ['תאריך התחלה', 'תאריך סיום'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/hi_IN';
|
||||
import TimePickerLocale from '../../time-picker/locale/hi_IN';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'तारीख़ चुनें',
|
||||
rangePlaceholder: ['प्रारंभ तिथि', 'समाप्ति तिथि'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/hr_HR';
|
||||
import TimePickerLocale from '../../time-picker/locale/hr_HR';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Odaberite datum',
|
||||
rangePlaceholder: ['Početni datum', 'Završni datum'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/hu_HU';
|
||||
import TimePickerLocale from '../../time-picker/locale/hu_HU';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Válasszon dátumot',
|
||||
rangePlaceholder: ['Kezdő dátum', 'Befejezés dátuma'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/id_ID';
|
||||
import TimePickerLocale from '../../time-picker/locale/id_ID';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Pilih tanggal',
|
||||
rangePlaceholder: ['Mulai tanggal', 'Tanggal akhir'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/is_IS';
|
||||
import TimePickerLocale from '../../time-picker/locale/is_IS';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Veldu dag',
|
||||
rangePlaceholder: ['Upphafsdagur', 'Lokadagur'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/it_IT';
|
||||
import TimePickerLocale from '../../time-picker/locale/it_IT';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Selezionare la data',
|
||||
rangePlaceholder: ["Data d'inizio", 'Data di fine'],
|
||||
|
@ -1,7 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ja_JP';
|
||||
import TimePickerLocale from '../../time-picker/locale/ja_JP';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
const locale = {
|
||||
// Merge into a locale object
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: '日付を選択',
|
||||
rangePlaceholder: ['開始日付', '終了日付'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/kn_IN';
|
||||
import TimePickerLocale from '../../time-picker/locale/kn_IN';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'ದಿನಾಂಕ ಆಯ್ಕೆಮಾಡಿ',
|
||||
rangePlaceholder: ['ಪ್ರಾರಂಭ ದಿನಾಂಕ', 'ಅಂತಿಮ ದಿನಾಂಕ'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ko_KR';
|
||||
import TimePickerLocale from '../../time-picker/locale/ko_KR';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: '날짜 선택',
|
||||
rangePlaceholder: ['시작일', '종료일'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ku_IQ';
|
||||
import TimePickerLocale from '../../time-picker/locale/ku_IQ';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Dîrok hilbijêre',
|
||||
rangePlaceholder: ['Dîroka destpêkê', 'Dîroka dawîn'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/lv_LV';
|
||||
import TimePickerLocale from '../../time-picker/locale/lv_LV';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Izvēlieties datumu',
|
||||
rangePlaceholder: ['Sākuma datums', 'Beigu datums'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/mk_MK';
|
||||
import TimePickerLocale from '../../time-picker/locale/mk_MK';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Избери датум',
|
||||
rangePlaceholder: ['Од датум', 'До датум'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/mn_MN';
|
||||
import TimePickerLocale from '../../time-picker/locale/mn_MN';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Огноо сонгох',
|
||||
rangePlaceholder: ['Эхлэх огноо', 'Дуусах огноо'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ms_MY';
|
||||
import TimePickerLocale from '../../time-picker/locale/ms_MY';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Pilih tarikh',
|
||||
rangePlaceholder: ['Tarikh mula', 'Tarikh akhir'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/nb_NO';
|
||||
import TimePickerLocale from '../../time-picker/locale/nb_NO';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Velg dato',
|
||||
rangePlaceholder: ['Startdato', 'Sluttdato'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/nl_BE';
|
||||
import TimePickerLocale from '../../time-picker/locale/nl_BE';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Selecteer datum',
|
||||
rangePlaceholder: ['Begin datum', 'Eind datum'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/nl_NL';
|
||||
import TimePickerLocale from '../../time-picker/locale/nl_NL';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Selecteer datum',
|
||||
rangePlaceholder: ['Begin datum', 'Eind datum'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/pl_PL';
|
||||
import TimePickerLocale from '../../time-picker/locale/pl_PL';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Wybierz datę',
|
||||
rangePlaceholder: ['Data początkowa', 'Data końcowa'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/pt_BR';
|
||||
import TimePickerLocale from '../../time-picker/locale/pt_BR';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Selecionar data',
|
||||
rangePlaceholder: ['Data inicial', 'Data final'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/pt_PT';
|
||||
import TimePickerLocale from '../../time-picker/locale/pt_PT';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
...CalendarLocale,
|
||||
placeholder: 'Data',
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ro_RO';
|
||||
import TimePickerLocale from '../../time-picker/locale/ro_RO';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Selectează data',
|
||||
rangePlaceholder: ['Data start', 'Data sfârșit'],
|
||||
|
@ -4,8 +4,10 @@
|
||||
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ru_RU';
|
||||
import TimePickerLocale from '../../time-picker/locale/ru_RU';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
const locale = {
|
||||
// Merge into a locale object
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Выберите дату',
|
||||
rangePlaceholder: ['Начальная дата', 'Конечная дата'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/sk_SK';
|
||||
import TimePickerLocale from '../../time-picker/locale/sk_SK';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// 统一合并为完整的 Locale
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Vybrať dátum',
|
||||
rangePlaceholder: ['Od', 'Do'],
|
||||
|
@ -1,7 +1,8 @@
|
||||
import TimePickerLocale from '../../time-picker/locale/sl_SI';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
locale: 'sl',
|
||||
placeholder: 'Izberite datum',
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/sr_RS';
|
||||
import TimePickerLocale from '../../time-picker/locale/sr_RS';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Izaberite datum',
|
||||
rangePlaceholder: ['Početni datum', 'Krajnji datum'],
|
||||
|
@ -1,7 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/sv_SE';
|
||||
import TimePickerLocale from '../../time-picker/locale/sv_SE';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
const locale = {
|
||||
// Merge into a locale object
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Välj datum',
|
||||
rangePlaceholder: ['Startdatum', 'Slutdatum'],
|
||||
|
@ -1,9 +1,10 @@
|
||||
// Tamil Locale added to rc-calendar
|
||||
import CalendarLocale from 'rc-picker/lib/locale/ta_IN';
|
||||
import TimePickerLocale from '../../time-picker/locale/ta_IN';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'தேதியைத் தேர்ந்தெடுக்கவும்',
|
||||
rangePlaceholder: ['தொடக்க தேதி', 'கடைசி தேதி'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/th_TH';
|
||||
import TimePickerLocale from '../../time-picker/locale/th_TH';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'เลือกวันที่',
|
||||
rangePlaceholder: ['วันเริ่มต้น', 'วันสิ้นสุด'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/tr_TR';
|
||||
import TimePickerLocale from '../../time-picker/locale/tr_TR';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Tarih Seç',
|
||||
rangePlaceholder: ['Başlangıç Tarihi', 'Bitiş Tarihi'],
|
||||
|
@ -1,7 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/uk_UA';
|
||||
import TimePickerLocale from '../../time-picker/locale/uk_UA';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
const locale = {
|
||||
// Merge into a locale object
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Оберіть дату',
|
||||
rangePlaceholder: ['Початкова дата', 'Кінцева дата'],
|
||||
|
@ -1,8 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/vi_VN';
|
||||
import TimePickerLocale from '../../time-picker/locale/vi_VN';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Chọn thời điểm',
|
||||
rangePlaceholder: ['Ngày bắt đầu', 'Ngày kết thúc'],
|
||||
|
@ -1,7 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/zh_CN';
|
||||
import TimePickerLocale from '../../time-picker/locale/zh_CN';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
const locale = {
|
||||
// 统一合并为完整的 Locale
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: '请选择日期',
|
||||
yearPlaceholder: '请选择年份',
|
||||
|
@ -1,7 +1,9 @@
|
||||
import CalendarLocale from 'rc-picker/lib/locale/zh_TW';
|
||||
import TimePickerLocale from '../../time-picker/locale/zh_TW';
|
||||
import { PickerLocale } from '../generatePicker';
|
||||
|
||||
const locale = {
|
||||
// 统一合并为完整的 Locale
|
||||
const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: '請選擇日期',
|
||||
rangePlaceholder: ['開始日期', '結束日期'],
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { PickerMode } from 'rc-picker/lib/interface';
|
||||
import { PickerLocale } from './generatePicker';
|
||||
|
||||
export function getPlaceholder(picker: PickerMode | undefined, locale: any): string {
|
||||
export function getPlaceholder(picker: PickerMode | undefined, locale: PickerLocale): string {
|
||||
if (picker === 'year' && locale.lang.yearPlaceholder) {
|
||||
return locale.lang.yearPlaceholder;
|
||||
}
|
||||
@ -16,7 +17,7 @@ export function getPlaceholder(picker: PickerMode | undefined, locale: any): str
|
||||
return locale.lang.placeholder;
|
||||
}
|
||||
|
||||
export function getRangePlaceholder(picker: PickerMode | undefined, locale: any): [string, string] {
|
||||
export function getRangePlaceholder(picker: PickerMode | undefined, locale: PickerLocale) {
|
||||
if (picker === 'year' && locale.lang.yearPlaceholder) {
|
||||
return locale.lang.rangeYearPlaceholder;
|
||||
}
|
||||
|
@ -9,13 +9,14 @@ import { TableLocale } from '../table/interface';
|
||||
import { PopconfirmLocale } from '../popconfirm';
|
||||
import { UploadLocale } from '../upload/interface';
|
||||
import { TransferLocale } from '../transfer';
|
||||
import { PickerLocale as DatePickerLocale } from '../date-picker/generatePicker';
|
||||
|
||||
export const ANT_MARK = 'internalMark';
|
||||
|
||||
export interface Locale {
|
||||
locale: string;
|
||||
Pagination?: PaginationLocale;
|
||||
DatePicker?: Object;
|
||||
DatePicker?: DatePickerLocale;
|
||||
TimePicker?: Object;
|
||||
Calendar?: Object;
|
||||
Table?: TableLocale;
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Locale } from '../locale-provider';
|
||||
import { PickerLocale } from '../date-picker/generatePicker';
|
||||
|
||||
const datePickerLocale = {
|
||||
const datePickerLocale: PickerLocale = {
|
||||
lang: {
|
||||
locale: 'hy-am',
|
||||
placeholder: 'Ընտրեք ամսաթիվը',
|
||||
|
Loading…
Reference in New Issue
Block a user