Browse Source

cz translation (#5169)

pull/4931/head
Martin Novák 8 years ago
committed by Wei Zhu
parent
commit
e59bb6b609
  1. 2
      components/calendar/locale/cs_CZ.tsx
  2. 17
      components/date-picker/locale/cs_CZ.tsx
  3. 3
      components/locale-provider/__tests__/index.test.js
  4. 45
      components/locale-provider/cs_CZ.tsx
  5. 5
      components/time-picker/locale/cs_CZ.tsx

2
components/calendar/locale/cs_CZ.tsx

@ -0,0 +1,2 @@
import cs_CZ from '../../date-picker/locale/cs_CZ';
export default cs_CZ;

17
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;

3
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(
<LocaleProvider locale={locale}>
<App />

45
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',
},
};

5
components/time-picker/locale/cs_CZ.tsx

@ -0,0 +1,5 @@
const locale = {
placeholder: 'Vybrat čas',
};
export default locale;
Loading…
Cancel
Save