Browse Source

feat: SK Localization (#5304)

pull/5446/merge
Martin Litvaj 8 years ago
committed by Benjy Cui
parent
commit
82b516c77f
  1. 2
      components/calendar/locale/sk_SK.tsx
  2. 17
      components/date-picker/locale/sk_SK.tsx
  3. 3
      components/locale-provider/__tests__/index.test.js
  4. 47
      components/locale-provider/sk_SK.tsx
  5. 5
      components/time-picker/locale/sk_SK.tsx

2
components/calendar/locale/sk_SK.tsx

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

17
components/date-picker/locale/sk_SK.tsx

@ -0,0 +1,17 @@
import CalendarLocale from 'rc-calendar/lib/locale/sk_SK';
import TimePickerLocale from '../../time-picker/locale/sk_SK';
import assign from 'object-assign';
// 统一合并为完整的 Locale
const locale = {
lang: assign({
placeholder: 'Vybrať dátum',
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

@ -14,6 +14,7 @@ import nlNL from '../nl_NL';
import caES from '../ca_ES';
import csCZ from '../cs_CZ';
import koKR from '../ko_KR';
import skSK from '../sk_SK';
const Option = Select.Option;
const RangePicker = DatePicker.RangePicker;
@ -59,7 +60,7 @@ const App = () => (
describe('Locale Provider', () => {
it('should display the text as locale changed', () => {
[enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR].forEach((locale) => {
[enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, skSK].forEach((locale) => {
const wrapper = mount(
<LocaleProvider locale={locale}>
<App />

47
components/locale-provider/sk_SK.tsx

@ -0,0 +1,47 @@
import moment from 'moment';
moment.locale('sk');
import Pagination from 'rc-pagination/lib/locale/sk_SK';
import DatePicker from '../date-picker/locale/sk_SK';
import TimePicker from '../time-picker/locale/sk_SK';
import Calendar from '../calendar/locale/sk_SK';
export default {
locale: 'sk',
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: 'Filter',
filterConfirm: 'OK',
filterReset: 'Obnoviť',
emptyText: 'Žiadne dáta',
selectAll: 'Vybrať všetko',
selectInvert: 'Vybrať opačné',
},
Modal: {
okText: 'OK',
cancelText: 'Zrušiť',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Zrušiť',
},
Transfer: {
notFoundContent: 'Nenájdené',
searchPlaceholder: 'Vyhľadávanie',
itemUnit: 'položka',
itemsUnit: 'položiek',
},
Select: {
notFoundContent: 'Nenájdené',
},
Upload: {
uploading: 'Nahrávanie...',
removeFile: 'Odstrániť súbor',
uploadError: 'Chyba pri nahrávaní',
previewFile: 'Zobraziť súbor',
},
};

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

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