-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
isIS.ts
100 lines (85 loc) · 3.42 KB
/
isIS.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import { PickersLocaleText } from './utils/pickersLocaleTextApi';
import { getPickersLocalization } from './utils/getPickersLocalization';
import { TimeViewWithMeridiem } from '../internals/models';
const timeViews: Record<TimeViewWithMeridiem, string> = {
hours: 'klukkustundir',
minutes: 'mínútur',
seconds: 'sekúndur',
meridiem: 'eftirmiðdagur',
};
const isISPickers: Partial<PickersLocaleText<any>> = {
// Calendar navigation
previousMonth: 'Fyrri mánuður',
nextMonth: 'Næsti mánuður',
// View navigation
openPreviousView: 'Opna fyrri skoðun',
openNextView: 'Opna næstu skoðun',
calendarViewSwitchingButtonAriaLabel: (view) =>
view === 'year'
? 'ársskoðun er opin, skipta yfir í dagatalsskoðun'
: 'dagatalsskoðun er opin, skipta yfir í ársskoðun',
// DateRange labels
start: 'Upphaf',
end: 'Endir',
// startDate: 'Start date',
// startTime: 'Start time',
// endDate: 'End date',
// endTime: 'End time',
// Action bar
cancelButtonLabel: 'Hætta við',
clearButtonLabel: 'Hreinsa',
okButtonLabel: 'OK',
todayButtonLabel: 'Í dag',
// Toolbar titles
datePickerToolbarTitle: 'Velja dagsetningu',
dateTimePickerToolbarTitle: 'Velja dagsetningu og tíma',
timePickerToolbarTitle: 'Velja tíma',
dateRangePickerToolbarTitle: 'Velja tímabil',
// Clock labels
clockLabelText: (view, time, utils, formattedTime) =>
`Velja ${timeViews[view]}. ${!formattedTime && (time === null || !utils.isValid(time)) ? 'Enginn tími valinn' : `Valinn tími er ${formattedTime ?? utils.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} klukkustundir`,
minutesClockNumberText: (minutes) => `${minutes} mínútur`,
secondsClockNumberText: (seconds) => `${seconds} sekúndur`,
// Digital clock labels
selectViewText: (view) => `Velja ${timeViews[view]}`,
// Calendar labels
calendarWeekNumberHeaderLabel: 'Vikunúmer',
calendarWeekNumberHeaderText: '#',
calendarWeekNumberAriaLabelText: (weekNumber) => `Vika ${weekNumber}`,
calendarWeekNumberText: (weekNumber) => `${weekNumber}`,
// Open picker labels
openDatePickerDialogue: (value, utils, formattedDate) =>
formattedDate || (value !== null && utils.isValid(value))
? `Velja dagsetningu, valin dagsetning er ${formattedDate ?? utils.format(value, 'fullDate')}`
: 'Velja dagsetningu',
openTimePickerDialogue: (value, utils, formattedTime) =>
formattedTime || (value !== null && utils.isValid(value))
? `Velja tíma, valinn tími er ${formattedTime ?? utils.format(value, 'fullTime')}`
: 'Velja tíma',
// fieldClearLabel: 'Clear',
// Table labels
timeTableLabel: 'velja tíma',
dateTableLabel: 'velja dagsetningu',
// Field section placeholders
fieldYearPlaceholder: (params) => 'Á'.repeat(params.digitAmount),
fieldMonthPlaceholder: (params) => (params.contentType === 'letter' ? 'MMMM' : 'MM'),
fieldDayPlaceholder: () => 'DD',
fieldWeekDayPlaceholder: (params) => (params.contentType === 'letter' ? 'EEEE' : 'EE'),
fieldHoursPlaceholder: () => 'kk',
fieldMinutesPlaceholder: () => 'mm',
fieldSecondsPlaceholder: () => 'ss',
fieldMeridiemPlaceholder: () => 'ee',
// View names
// year: 'Year',
// month: 'Month',
// day: 'Day',
// weekDay: 'Week day',
// hours: 'Hours',
// minutes: 'Minutes',
// seconds: 'Seconds',
// meridiem: 'Meridiem',
// Common
// empty: 'Empty',
};
export const isIS = getPickersLocalization(isISPickers);