From 08e06f41aad13cd5a1f315c6b765c590b532f08e Mon Sep 17 00:00:00 2001 From: Oleksandr Kovalchuk Date: Sat, 11 Nov 2017 16:18:54 +0200 Subject: [PATCH 1/3] Add uk-UA localization Ukrainian localization for the following components: - locale-provider - DatePicker - TimePicker - Calendar --- components/calendar/locale/uk_UA.tsx | 2 ++ components/date-picker/locale/uk_UA.tsx | 18 ++++++++++ components/locale-provider/uk_UA.tsx | 47 +++++++++++++++++++++++++ components/time-picker/locale/uk_UA.tsx | 5 +++ 4 files changed, 72 insertions(+) create mode 100644 components/calendar/locale/uk_UA.tsx create mode 100644 components/date-picker/locale/uk_UA.tsx create mode 100644 components/locale-provider/uk_UA.tsx create mode 100644 components/time-picker/locale/uk_UA.tsx diff --git a/components/calendar/locale/uk_UA.tsx b/components/calendar/locale/uk_UA.tsx new file mode 100644 index 000000000000..b27523dd7f8c --- /dev/null +++ b/components/calendar/locale/uk_UA.tsx @@ -0,0 +1,2 @@ +import uk_UA from '../../date-picker/locale/uk_UA'; +export default uk_UA; diff --git a/components/date-picker/locale/uk_UA.tsx b/components/date-picker/locale/uk_UA.tsx new file mode 100644 index 000000000000..1ae866f151f6 --- /dev/null +++ b/components/date-picker/locale/uk_UA.tsx @@ -0,0 +1,18 @@ +import CalendarLocale from 'rc-calendar/lib/locale/uk_UA'; +import TimePickerLocale from '../../time-picker/locale/uk_UA'; + +const locale = { + lang: { + placeholder: 'Оберіть дату', + rangePlaceholder: ['Початкова дата', 'Кінцева дата'], + ...CalendarLocale, + }, + timePickerLocale: { + ...TimePickerLocale, + }, +}; + +// All settings at: +// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json + +export default locale; diff --git a/components/locale-provider/uk_UA.tsx b/components/locale-provider/uk_UA.tsx new file mode 100644 index 000000000000..42edd6eb4d76 --- /dev/null +++ b/components/locale-provider/uk_UA.tsx @@ -0,0 +1,47 @@ +import moment from 'moment'; +moment.locale('uk'); + +import Pagination from 'rc-pagination/lib/locale/uk_UA'; +import DatePicker from '../date-picker/locale/uk_UA'; +import TimePicker from '../time-picker/locale/uk_UA'; +import Calendar from '../calendar/locale/uk_UA'; + +export default { + locale: 'uk', + Pagination, + DatePicker, + TimePicker, + Calendar, + Table: { + filterTitle: 'Фільтрувати', + filterConfirm: 'OK', + filterReset: 'Скинути', + emptyText: 'Даних немає', + selectAll: 'Обрати всі', + selectInvert: 'Інвертувати вибір', + }, + Modal: { + okText: 'Гаразд', + cancelText: 'Скасувати', + justOkText: 'Гаразд', + }, + Popconfirm: { + okText: 'Гаразд', + cancelText: 'Скасувати', + }, + Transfer: { + notFoundContent: 'Нічого не знайдено', + searchPlaceholder: 'Введіть текст для пошуку', + itemUnit: 'item', + itemsUnit: 'items', + }, + Select: { + notFoundContent: 'Нічого не знайдено', + }, + Upload: { + uploading: 'Завантаження ...', + removeFile: 'Видалити файл', + uploadError: 'Помилка завантаження', + previewFile: 'Попередній перегляд файлу', + }, +}; diff --git a/components/time-picker/locale/uk_UA.tsx b/components/time-picker/locale/uk_UA.tsx new file mode 100644 index 000000000000..20a81cc5354c --- /dev/null +++ b/components/time-picker/locale/uk_UA.tsx @@ -0,0 +1,5 @@ +const locale = { + placeholder: 'Оберіть час', +}; + +export default locale; From 33086f1cdaad86530ae6ab9dc2af6aefdc92e517 Mon Sep 17 00:00:00 2001 From: Oleksandr Kovalchuk Date: Sat, 11 Nov 2017 16:51:21 +0200 Subject: [PATCH 2/3] Add uk_UA locale to test suite --- components/locale-provider/__tests__/index.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/locale-provider/__tests__/index.test.js b/components/locale-provider/__tests__/index.test.js index 3c88d4249ed0..d442344e4c5b 100644 --- a/components/locale-provider/__tests__/index.test.js +++ b/components/locale-provider/__tests__/index.test.js @@ -36,8 +36,9 @@ import nbNO from '../nb_NO'; import srRS from '../sr_RS'; import isIS from '../is_IS'; import arEG from '../ar_EG'; +import ukUA from '../uk_UA'; -const locales = [enUS, ptBR, ptPT, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, plPL, bgBG, enGB, frFR, nlBE, itIT, viVN, thTH, faIR, elGR, nbNO, srRS, isIS, arEG]; +const locales = [enUS, ptBR, ptPT, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, plPL, bgBG, enGB, frFR, nlBE, itIT, viVN, thTH, faIR, elGR, nbNO, srRS, isIS, arEG, ukUA]; const { Option } = Select; const { RangePicker } = DatePicker; From 6c70e14d379108edb5a6a3b826eaed7e59e9bb99 Mon Sep 17 00:00:00 2001 From: Oleksandr Kovalchuk Date: Tue, 14 Nov 2017 09:53:14 +0200 Subject: [PATCH 3/3] Add uk_UA locale to tests snapshot Tests on CI are failing because there are no snapshot for uk_UA locale. Generate a snapshot with `npm test -u` command and add it to the test suite. --- .../__snapshots__/index.test.js.snap | 1565 +++++++++++++++++ 1 file changed, 1565 insertions(+) diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index 82e81044452f..aba691e95cb9 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -50079,3 +50079,1568 @@ exports[`Locale Provider should display the text as locale changed 32`] = ` `; + +exports[`Locale Provider should display the text as locale changed 33`] = ` +
+ +
+ +
+ +
+ + +
+
+ + + + + + + + + ~ + + + + + +
+ Click to confirm + +
+
+
+
+
+
+
+
+ +
+ Question? +
+
+
+ + +
+
+
+
+
+
+
+
+
+
+ + + + 0 item + + + +
+ +
+
+ + +
+
+
+ + + + 0 item + + + +
+ +
+
+
+
+
+ +
+
+ +
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + пн + + + + вт + + + + ср + + + + чт + + + + пт + + + + сб + + + + нд + +
+
+
+ 28 +
+
+
+
+
+
+ 29 +
+
+
+
+
+
+ 30 +
+
+
+
+
+
+ 31 +
+
+
+
+
+
+ 01 +
+
+
+
+
+
+ 02 +
+
+
+
+
+
+ 03 +
+
+
+
+
+
+ 04 +
+
+
+
+
+
+ 05 +
+
+
+
+
+
+ 06 +
+
+
+
+
+
+ 07 +
+
+
+
+
+
+ 08 +
+
+
+
+
+
+ 09 +
+
+
+
+
+
+ 10 +
+
+
+
+
+
+ 11 +
+
+
+
+
+
+ 12 +
+
+
+
+
+
+ 13 +
+
+
+
+
+
+ 14 +
+
+
+
+
+
+ 15 +
+
+
+
+
+
+ 16 +
+
+
+
+
+
+ 17 +
+
+
+
+
+
+ 18 +
+
+
+
+
+
+ 19 +
+
+
+
+
+
+ 20 +
+
+
+
+
+
+ 21 +
+
+
+
+
+
+ 22 +
+
+
+
+
+
+ 23 +
+
+
+
+
+
+ 24 +
+
+
+
+
+
+ 25 +
+
+
+
+
+
+ 26 +
+
+
+
+
+
+ 27 +
+
+
+
+
+
+ 28 +
+
+
+
+
+
+ 29 +
+
+
+
+
+
+ 30 +
+
+
+
+
+
+ 01 +
+
+
+
+
+
+ 02 +
+
+
+
+
+
+ 03 +
+
+
+
+
+
+ 04 +
+
+
+
+
+
+ 05 +
+
+
+
+
+
+ 06 +
+
+
+
+
+
+ 07 +
+
+
+
+
+
+ 08 +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + +
+ + Name + + + + + Age + +
+
+
+ Даних немає +
+
+
+
+
+
+
+
+ +
+
+`;