From e59bb6b609304901e81725eb00e4dd6f85b14959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Nov=C3=A1k?= Date: Sun, 5 Mar 2017 13:11:24 +0100 Subject: [PATCH] cz translation (#5169) --- components/calendar/locale/cs_CZ.tsx | 2 + components/date-picker/locale/cs_CZ.tsx | 17 +++++++ .../locale-provider/__tests__/index.test.js | 3 +- components/locale-provider/cs_CZ.tsx | 45 +++++++++++++++++++ components/time-picker/locale/cs_CZ.tsx | 5 +++ 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 components/calendar/locale/cs_CZ.tsx create mode 100644 components/date-picker/locale/cs_CZ.tsx create mode 100644 components/locale-provider/cs_CZ.tsx create mode 100644 components/time-picker/locale/cs_CZ.tsx diff --git a/components/calendar/locale/cs_CZ.tsx b/components/calendar/locale/cs_CZ.tsx new file mode 100644 index 0000000000..bfba281a99 --- /dev/null +++ b/components/calendar/locale/cs_CZ.tsx @@ -0,0 +1,2 @@ +import cs_CZ from '../../date-picker/locale/cs_CZ'; +export default cs_CZ; diff --git a/components/date-picker/locale/cs_CZ.tsx b/components/date-picker/locale/cs_CZ.tsx new file mode 100644 index 0000000000..edac35cdd5 --- /dev/null +++ b/components/date-picker/locale/cs_CZ.tsx @@ -0,0 +1,17 @@ +import CalendarLocale from 'rc-calendar/lib/locale/cs_CZ'; +import TimePickerLocale from '../../time-picker/locale/cs_CZ'; +import assign from 'object-assign'; + +// 统一合并为完整的 Locale +const locale = { + lang: assign({ + placeholder: 'Vybrat datum', + rangePlaceholder: ['Od', 'Do'], + }, CalendarLocale), + timePickerLocale: assign({}, 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/__tests__/index.test.js b/components/locale-provider/__tests__/index.test.js index 6516f8db38..3365ae8252 100644 --- a/components/locale-provider/__tests__/index.test.js +++ b/components/locale-provider/__tests__/index.test.js @@ -12,6 +12,7 @@ import frBE from '../fr_BE'; import deDE from '../de_DE'; import nlNL from '../nl_NL'; import caES from '../ca_ES'; +import csCZ from '../cs_CZ'; const Option = Select.Option; const RangePicker = DatePicker.RangePicker; @@ -57,7 +58,7 @@ const App = () => ( describe('Locale Provider', () => { it('should display the text as locale changed', () => { - [enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES].forEach((locale) => { + [enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ].forEach((locale) => { const wrapper = mount( diff --git a/components/locale-provider/cs_CZ.tsx b/components/locale-provider/cs_CZ.tsx new file mode 100644 index 0000000000..6a3075aa0d --- /dev/null +++ b/components/locale-provider/cs_CZ.tsx @@ -0,0 +1,45 @@ +import moment from 'moment'; +moment.locale('cs'); + +import Pagination from 'rc-pagination/lib/locale/cs_CZ'; +import DatePicker from '../date-picker/locale/cs_CZ'; +import TimePicker from '../time-picker/locale/cs_CZ'; +import Calendar from '../calendar/locale/cs_CZ'; + +export default { + locale: 'cs', + Pagination, + DatePicker, + TimePicker, + Calendar, + Table: { + filterTitle: 'Filtr', + filterConfirm: 'Potvrdit', + filterReset: 'Obnovit', + emptyText: 'Žádná data', + }, + Modal: { + okText: 'Ok', + cancelText: 'Storno', + justOkText: 'Ok', + }, + Popconfirm: { + okText: 'Ok', + cancelText: 'Storno', + }, + Transfer: { + notFoundContent: 'Nenalezeno', + searchPlaceholder: 'Vyhledávání', + itemUnit: 'položka', + itemsUnit: 'položek', + }, + Select: { + notFoundContent: 'Nenalezeno', + }, + Upload: { + uploading: 'Nahrávání...', + removeFile: 'Odstranit soubor', + uploadError: 'Chyba při nahrávání', + previewFile: 'Zobrazit soubor', + }, +}; diff --git a/components/time-picker/locale/cs_CZ.tsx b/components/time-picker/locale/cs_CZ.tsx new file mode 100644 index 0000000000..5c89f7affc --- /dev/null +++ b/components/time-picker/locale/cs_CZ.tsx @@ -0,0 +1,5 @@ +const locale = { + placeholder: 'Vybrat čas', +}; + +export default locale;