Skip to content

Commit

Permalink
cz translation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinnov92 committed Mar 5, 2017
1 parent 9a9db14 commit 4f05e2c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/calendar/locale/cs_CZ.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import cs_CZ from '../../date-picker/locale/cs_CZ';
export default cs_CZ;
17 changes: 17 additions & 0 deletions components/date-picker/locale/cs_CZ.tsx
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 1 deletion components/locale-provider/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 />
Expand Down
45 changes: 45 additions & 0 deletions components/locale-provider/cs_CZ.tsx
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions components/time-picker/locale/cs_CZ.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const locale = {
placeholder: 'Vybrat čas',
};

export default locale;

0 comments on commit 4f05e2c

Please sign in to comment.