From fd233cf430eb47c1940927beeb5ddaa94f108599 Mon Sep 17 00:00:00 2001 From: Simon Waloschek Date: Wed, 25 Jan 2017 14:12:27 +0100 Subject: [PATCH] Added German locale (#4686) * Added German locale * Added German locale for pagination --- components/calendar/locale/de_DE.tsx | 2 ++ components/date-picker/locale/de_DE.tsx | 17 +++++++++++ components/locale-provider/de_DE.tsx | 39 +++++++++++++++++++++++++ components/pagination/locale/de_DE.tsx | 2 ++ components/time-picker/locale/de_DE.tsx | 5 ++++ 5 files changed, 65 insertions(+) create mode 100644 components/calendar/locale/de_DE.tsx create mode 100644 components/date-picker/locale/de_DE.tsx create mode 100644 components/locale-provider/de_DE.tsx create mode 100644 components/pagination/locale/de_DE.tsx create mode 100644 components/time-picker/locale/de_DE.tsx diff --git a/components/calendar/locale/de_DE.tsx b/components/calendar/locale/de_DE.tsx new file mode 100644 index 0000000000..652a9be31e --- /dev/null +++ b/components/calendar/locale/de_DE.tsx @@ -0,0 +1,2 @@ +import de_DE from '../../date-picker/locale/de_DE'; +export default de_DE; diff --git a/components/date-picker/locale/de_DE.tsx b/components/date-picker/locale/de_DE.tsx new file mode 100644 index 0000000000..66a2bbae54 --- /dev/null +++ b/components/date-picker/locale/de_DE.tsx @@ -0,0 +1,17 @@ +import CalendarLocale from 'rc-calendar/lib/locale/de_DE'; +import TimePickerLocale from '../../time-picker/locale/de_DE'; +import assign from 'object-assign'; + +// 统一合并为完整的 Locale +const locale = { + lang: assign({ + placeholder: 'Datum auswählen', + rangePlaceholder: ['Startdatum', 'Enddatum'], + }, CalendarLocale), + timePickerLocale: assign({}, TimePickerLocale), +}; + +// All settings at: +// https://github.com/ant-design/ant-design/issues/424 + +export default locale; diff --git a/components/locale-provider/de_DE.tsx b/components/locale-provider/de_DE.tsx new file mode 100644 index 0000000000..e09d9af7da --- /dev/null +++ b/components/locale-provider/de_DE.tsx @@ -0,0 +1,39 @@ +import moment from 'moment'; +moment.locale('de'); + +import Pagination from 'rc-pagination/lib/locale/de_DE'; +import DatePicker from '../date-picker/locale/de_DE'; +import TimePicker from '../time-picker/locale/de_DE'; +import Calendar from '../calendar/locale/de_DE'; + +export default { + locale: 'de', + Pagination, + DatePicker, + TimePicker, + Calendar, + Table: { + filterTitle: 'Filter-Menü', + filterConfirm: 'OK', + filterReset: 'Zurücksetzen', + emptyText: 'Keine Daten', + }, + Modal: { + okText: 'OK', + cancelText: 'Abbrechen', + justOkText: 'OK', + }, + Popconfirm: { + okText: 'OK', + cancelText: 'Abbrechen', + }, + Transfer: { + notFoundContent: 'Nicht gefunden', + searchPlaceholder: 'Suchen', + itemUnit: 'Eintrag', + itemsUnit: 'Einträge', + }, + Select: { + notFoundContent: 'Nicht gefunden', + }, +}; diff --git a/components/pagination/locale/de_DE.tsx b/components/pagination/locale/de_DE.tsx new file mode 100644 index 0000000000..c122ae7b2d --- /dev/null +++ b/components/pagination/locale/de_DE.tsx @@ -0,0 +1,2 @@ +import de_DE from 'rc-pagination/lib/locale/de_DE'; +export default de_DE; diff --git a/components/time-picker/locale/de_DE.tsx b/components/time-picker/locale/de_DE.tsx new file mode 100644 index 0000000000..c912e9e8fb --- /dev/null +++ b/components/time-picker/locale/de_DE.tsx @@ -0,0 +1,5 @@ +const locale = { + placeholder: 'Zeit auswählen', +}; + +export default locale;