Skip to content

Commit 10339ab

Browse files
author
Dmitriy Sanko
committed
Make translation keys unique
1 parent 2618db1 commit 10339ab

File tree

5 files changed

+80
-86
lines changed

5 files changed

+80
-86
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opuscapita/react-dates",
3-
"version": "0.5.16",
3+
"version": "0.5.16-EPROC-20549-SNAPSHOT",
44
"description": "Start write new project with no effort.",
55
"keywords": [
66
"react",

src/client/components/DateInput/DateInput.react.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ let defaultProps = {
5151
value: null,
5252
variants: [
5353
{
54-
getLabel: (locale) => getMessage(locale, 'yesterday'),
54+
getLabel: (locale) => getMessage(locale, 'common.DateInput.yesterday'),
5555
getValue: (locale) => dayjs().locale(locale).subtract(1, 'days').toDate()
5656
},
5757
{
58-
getLabel: (locale) => getMessage(locale, 'today'),
58+
getLabel: (locale) => getMessage(locale, 'common.DateInput.today'),
5959
getValue: (locale) => dayjs().locale(locale).toDate()
6060
},
6161
{
62-
getLabel: (locale) => getMessage(locale, 'tomorrow'),
62+
getLabel: (locale) => getMessage(locale, 'common.DateInput.tomorrow'),
6363
getValue: (locale) => dayjs().locale(locale).add(1, 'days').toDate()
6464
}
6565
]
@@ -290,7 +290,7 @@ ${showToTopClassName} ${showToLeftClassName}
290290
tabIndex="-1"
291291
onClick={this.handleReset}
292292
disabled={disabled}
293-
title={getMessage(locale, 'clearValue')}
293+
title={getMessage(locale, 'common.DateInput.clearValue')}
294294
>
295295
296296
</InputAddonButton>

src/client/components/DateRangeInput/DateRangeInput.react.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ let defaultProps = {
6565
value: [null, null],
6666
variants: [
6767
{
68-
getLabel: (locale) => getMessage(locale, 'previousWeek'),
68+
getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.previousWeek'),
6969
// TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215
7070
getValue: (locale) => locale === 'en' ? [
7171
dayjs().locale(locale).subtract(7, 'days').startOf('week').toDate(),
@@ -76,7 +76,7 @@ let defaultProps = {
7676
]
7777
},
7878
{
79-
getLabel: (locale) => getMessage(locale, 'thisWeek'),
79+
getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.thisWeek'),
8080
// TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215
8181
getValue: (locale) => locale === 'en' ? [
8282
dayjs().locale(locale).startOf('week').toDate(),
@@ -87,7 +87,7 @@ let defaultProps = {
8787
]
8888
},
8989
{
90-
getLabel: (locale) => getMessage(locale, 'nextWeek'),
90+
getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.nextWeek'),
9191
// TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215
9292
getValue: (locale) => locale === 'en' ? [
9393
dayjs().locale(locale).add(7, 'days').startOf('week').toDate(),
@@ -98,28 +98,28 @@ let defaultProps = {
9898
]
9999
},
100100
{
101-
getLabel: (locale) => getMessage(locale, 'previousMonth'),
101+
getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.previousMonth'),
102102
getValue: (locale) => [
103103
dayjs().locale(locale).subtract(1, 'month').startOf('month').toDate(),
104104
dayjs().locale(locale).subtract(1, 'month').endOf('month').toDate()
105105
]
106106
},
107107
{
108-
getLabel: (locale) => getMessage(locale, 'last30Days'),
108+
getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.last30Days'),
109109
getValue: (locale) => [
110110
dayjs().locale(locale).subtract(30, 'days').toDate(),
111111
dayjs().locale(locale).toDate()
112112
]
113113
},
114114
{
115-
getLabel: (locale) => getMessage(locale, 'thisMonth'),
115+
getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.thisMonth'),
116116
getValue: (locale) => [
117117
dayjs().locale(locale).startOf('month').toDate(),
118118
dayjs().locale(locale).endOf('month').toDate()
119119
]
120120
},
121121
{
122-
getLabel: (locale) => getMessage(locale, 'nextMonth'),
122+
getLabel: (locale) => getMessage(locale, 'common.DateRangeInput.nextMonth'),
123123
getValue: (locale) => [
124124
dayjs().locale(locale).add(1, 'month').startOf('month').toDate(),
125125
dayjs().locale(locale).add(1, 'month').endOf('month').toDate()
@@ -443,7 +443,7 @@ class DateRangeInput extends Component {
443443
tabIndex="-1"
444444
onClick={this.handleReset}
445445
disabled={disabled}
446-
title={getMessage(locale, 'clearValue')}
446+
title={getMessage(locale, 'common.DateInput.clearValue')}
447447
>
448448
449449
</InputAddonButton>

src/client/components/DayPicker/DayPicker.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let propTypes = {
2323
let defaultProps = {
2424
className: '',
2525
dayPickerRef: () => {},
26-
getTodayButtonLabel: (locale) => getMessage(locale, 'today'),
26+
getTodayButtonLabel: (locale) => getMessage(locale, 'common.DateInput.today'),
2727
hideTodayButton: false,
2828
isRange: false,
2929
labels: ReactDayPicker.defaultProps.labels,

src/client/components/translations.js

Lines changed: 66 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,81 @@
11
const translations = {
22
en: {
3-
selectDateRange: 'Select date range',
4-
today: 'Today',
5-
yesterday: 'Yesterday',
6-
tomorrow: 'Tomorrow',
7-
previousWeek: 'Previous week',
8-
nextWeek: 'Next week',
9-
thisWeek: 'This week',
10-
previousMonth: 'Previous month',
11-
last30Days: 'Last 30 days',
12-
thisMonth: 'This month',
13-
nextMonth: 'Next month',
14-
clearValue: 'Clear value'
3+
'common.DateInput.today': 'Today',
4+
'common.DateInput.yesterday': 'Yesterday',
5+
'common.DateInput.tomorrow': 'Tomorrow',
6+
'common.DateRangeInput.previousWeek': 'Previous week',
7+
'common.DateRangeInput.nextWeek': 'Next week',
8+
'common.DateRangeInput.thisWeek': 'This week',
9+
'common.DateRangeInput.previousMonth': 'Previous month',
10+
'common.DateRangeInput.last30Days': 'Last 30 days',
11+
'common.DateRangeInput.thisMonth': 'This month',
12+
'common.DateRangeInput.nextMonth': 'Next month',
13+
'common.DateInput.clearValue': 'Clear value'
1514
},
1615
de: {
17-
selectDateRange: 'Datumsbereich auswählen',
18-
today: 'Heute',
19-
yesterday: 'Gestern',
20-
tomorrow: 'Morgen',
21-
previousWeek: 'Vorherige Woche',
22-
nextWeek: 'Nächste Woche',
23-
thisWeek: 'Diese Woche',
24-
previousMonth: 'Vorheriger Monat',
25-
last30Days: 'Letzte 30 Tagen',
26-
thisMonth: 'Dieser Monat',
27-
nextMonth: 'Nächster Monat',
28-
clearValue: 'Inhalt löschen'
16+
'common.DateInput.today': 'Heute',
17+
'common.DateInput.yesterday': 'Gestern',
18+
'common.DateInput.tomorrow': 'Morgen',
19+
'common.DateRangeInput.previousWeek': 'Vorherige Woche',
20+
'common.DateRangeInput.nextWeek': 'Nächste Woche',
21+
'common.DateRangeInput.thisWeek': 'Diese Woche',
22+
'common.DateRangeInput.previousMonth': 'Vorheriger Monat',
23+
'common.DateRangeInput.last30Days': 'Letzte 30 Tagen',
24+
'common.DateRangeInput.thisMonth': 'Dieser Monat',
25+
'common.DateRangeInput.nextMonth': 'Nächster Monat',
26+
'common.DateInput.clearValue': 'Inhalt löschen'
2927
},
3028
ru: {
31-
selectDateRange: 'Выберите диапазон дат',
32-
today: 'Сегодня',
33-
yesterday: 'Вчера',
34-
tomorrow: 'Завтра',
35-
previousWeek: 'Предыдущая неделя',
36-
nextWeek: 'Следующая неделя',
37-
thisWeek: 'Эта неделя',
38-
previousMonth: 'Предыдущий месяц',
39-
last30Days: 'Последние 30 дней',
40-
thisMonth: 'Этот месяц',
41-
nextMonth: 'Следующий месяц',
42-
clearValue: ''
29+
'common.DateInput.today': 'Сегодня',
30+
'common.DateInput.yesterday': 'Вчера',
31+
'common.DateInput.tomorrow': 'Завтра',
32+
'common.DateRangeInput.previousWeek': 'Предыдущая неделя',
33+
'common.DateRangeInput.nextWeek': 'Следующая неделя',
34+
'common.DateRangeInput.thisWeek': 'Эта неделя',
35+
'common.DateRangeInput.previousMonth': 'Предыдущий месяц',
36+
'common.DateRangeInput.last30Days': 'Последние 30 дней',
37+
'common.DateRangeInput.thisMonth': 'Этот месяц',
38+
'common.DateRangeInput.nextMonth': 'Следующий месяц',
39+
'common.DateInput.clearValue': ''
4340
},
4441
fi: {
45-
selectDateRange: 'Valitse päivämääräväli',
46-
today: 'Tänään',
47-
yesterday: 'Eilen',
48-
tomorrow: 'Huomenna',
49-
previousWeek: 'Edellinen viikko',
50-
nextWeek: 'Seuraava viikko',
51-
thisWeek: 'Tämä viikko',
52-
previousMonth: 'Edellinen kuukausi',
53-
last30Days: 'Edelliset 30 päivää',
54-
thisMonth: 'Tämä kuukausi',
55-
nextMonth: 'Seuraava kuukausi',
56-
clearValue: ''
42+
'common.DateInput.today': 'Tänään',
43+
'common.DateInput.yesterday': 'Eilen',
44+
'common.DateInput.tomorrow': 'Huomenna',
45+
'common.DateRangeInput.previousWeek': 'Edellinen viikko',
46+
'common.DateRangeInput.nextWeek': 'Seuraava viikko',
47+
'common.DateRangeInput.thisWeek': 'Tämä viikko',
48+
'common.DateRangeInput.previousMonth': 'Edellinen kuukausi',
49+
'common.DateRangeInput.last30Days': 'Edelliset 30 päivää',
50+
'common.DateRangeInput.thisMonth': 'Tämä kuukausi',
51+
'common.DateRangeInput.nextMonth': 'Seuraava kuukausi',
52+
'common.DateInput.clearValue': ''
5753
},
5854
no: {
59-
selectDateRange: 'Velg datoområde',
60-
today: 'I dag',
61-
yesterday: 'I går',
62-
tomorrow: 'I morgen',
63-
previousWeek: 'Forrige uke',
64-
nextWeek: 'Neste uke',
65-
thisWeek: 'Denne uken',
66-
previousMonth: 'Foregående måned',
67-
last30Days: 'Siste 30 dager',
68-
thisMonth: 'Denne måneden',
69-
nextMonth: 'Neste måned',
70-
clearValue: ''
55+
'common.DateInput.today': 'I dag',
56+
'common.DateInput.yesterday': 'I går',
57+
'common.DateInput.tomorrow': 'I morgen',
58+
'common.DateRangeInput.previousWeek': 'Forrige uke',
59+
'common.DateRangeInput.nextWeek': 'Neste uke',
60+
'common.DateRangeInput.thisWeek': 'Denne uken',
61+
'common.DateRangeInput.previousMonth': 'Foregående måned',
62+
'common.DateRangeInput.last30Days': 'Siste 30 dager',
63+
'common.DateRangeInput.thisMonth': 'Denne måneden',
64+
'common.DateRangeInput.nextMonth': 'Neste måned',
65+
'common.DateInput.clearValue': ''
7166
},
7267
sv: {
73-
selectDateRange: 'Välj datumintervall',
74-
today: 'Idag',
75-
yesterday: 'Igår',
76-
tomorrow: 'Imorgon',
77-
previousWeek: 'Föregående vecka',
78-
nextWeek: 'Nästa vecka',
79-
thisWeek: 'Denna vecka',
80-
previousMonth: 'Föregående månad',
81-
last30Days: 'SSenaste 30 dagarna',
82-
thisMonth: 'Denna månad',
83-
nextMonth: 'Nästa månad',
84-
clearValue: ''
68+
'common.DateInput.today': 'Idag',
69+
'common.DateInput.yesterday': 'Igår',
70+
'common.DateInput.tomorrow': 'Imorgon',
71+
'common.DateRangeInput.previousWeek': 'Föregående vecka',
72+
'common.DateRangeInput.nextWeek': 'Nästa vecka',
73+
'common.DateRangeInput.thisWeek': 'Denna vecka',
74+
'common.DateRangeInput.previousMonth': 'Föregående månad',
75+
'common.DateRangeInput.last30Days': 'SSenaste 30 dagarna',
76+
'common.DateRangeInput.thisMonth': 'Denna månad',
77+
'common.DateRangeInput.nextMonth': 'Nästa månad',
78+
'common.DateInput.clearValue': ''
8579
}
8680
};
8781

0 commit comments

Comments
 (0)