mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
Add locale ca_ES (Catalan) (#4929)
* Add locale ca_ES (Catalan) * Add locale ca_ES (Catalan). Modify global locale in local-provider.
This commit is contained in:
parent
63476d0bc0
commit
05fd5a6825
2
components/calendar/locale/ca_ES.tsx
Normal file
2
components/calendar/locale/ca_ES.tsx
Normal file
@ -0,0 +1,2 @@
|
||||
import ca_ES from '../../date-picker/locale/ca_ES';
|
||||
export default ca_ES;
|
17
components/date-picker/locale/ca_ES.tsx
Normal file
17
components/date-picker/locale/ca_ES.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import CalendarLocale from 'rc-calendar/lib/locale/ca_ES';
|
||||
import TimePickerLocale from '../../time-picker/locale/ca_ES';
|
||||
import assign from 'object-assign';
|
||||
|
||||
// 统一合并为完整的 Locale
|
||||
const locale = {
|
||||
lang: assign({
|
||||
placeholder: 'Seleccionar data',
|
||||
rangePlaceholder: ['Data inicial', 'Data final'],
|
||||
}, 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;
|
@ -11,6 +11,7 @@ import svSE from '../sv_SE';
|
||||
import frBE from '../fr_BE';
|
||||
import deDE from '../de_DE';
|
||||
import nlNL from '../nl_NL';
|
||||
import caES from '../ca_ES';
|
||||
|
||||
const Option = Select.Option;
|
||||
const RangePicker = DatePicker.RangePicker;
|
||||
@ -56,7 +57,7 @@ const App = () => (
|
||||
|
||||
describe('Locale Provider', () => {
|
||||
it('should display the text as locale changed', () => {
|
||||
[enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL].forEach((locale) => {
|
||||
[enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES].forEach((locale) => {
|
||||
const wrapper = mount(
|
||||
<LocaleProvider locale={locale}>
|
||||
<App />
|
||||
|
39
components/locale-provider/ca_ES.tsx
Normal file
39
components/locale-provider/ca_ES.tsx
Normal file
@ -0,0 +1,39 @@
|
||||
import moment from 'moment';
|
||||
moment.locale('ca');
|
||||
|
||||
import Pagination from 'rc-pagination/lib/locale/ca_ES';
|
||||
import DatePicker from '../date-picker/locale/ca_ES';
|
||||
import TimePicker from '../time-picker/locale/ca_ES';
|
||||
import Calendar from '../calendar/locale/ca_ES';
|
||||
|
||||
export default {
|
||||
locale: 'ca',
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'Filtrar Menu',
|
||||
filterConfirm: 'OK',
|
||||
filterReset: 'Restablir',
|
||||
emptyText: 'Sense dades',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'OK',
|
||||
cancelText: 'Cancel·lar',
|
||||
justOkText: 'OK',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: 'OK',
|
||||
cancelText: 'Cancel·lar',
|
||||
},
|
||||
Transfer: {
|
||||
notFoundContent: 'No trobat',
|
||||
searchPlaceholder: 'Cercar aquí',
|
||||
itemUnit: 'item',
|
||||
itemsUnit: 'items',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'No trobat',
|
||||
},
|
||||
};
|
5
components/time-picker/locale/ca_ES.tsx
Normal file
5
components/time-picker/locale/ca_ES.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
const locale = {
|
||||
placeholder: 'Seleccionar hora',
|
||||
};
|
||||
|
||||
export default locale;
|
Loading…
Reference in New Issue
Block a user