Browse Source

feat: locale-provider

pull/309/head
tangjinzhou 6 years ago
parent
commit
e2cc5eb252
  1. 5
      components/locale-provider/__tests__/index.test.js
  2. 1
      components/locale-provider/default.js
  3. 5
      components/locale-provider/it_IT.js
  4. 44
      components/locale-provider/mn_MN.js
  5. 6
      components/locale-provider/ru_RU.js
  6. 1
      components/locale-provider/zh_CN.js

5
components/locale-provider/__tests__/index.test.js

@ -41,8 +41,9 @@ import arEG from '../ar_EG'
import ukUA from '../uk_UA'
import zhCN from '../zh_CN'
import kuIQ from '../ku_IQ'
import mnMN from '../mn_MN'
const locales = [enUS, ptBR, ptPT, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, plPL, bgBG, enGB, frFR, nlBE, itIT, viVN, thTH, faIR, elGR, nbNO, srRS, slSI, isIS, arEG, ukUA, zhCN, kuIQ]
const locales = [enUS, ptBR, ptPT, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, plPL, bgBG, enGB, frFR, nlBE, itIT, viVN, thTH, faIR, elGR, nbNO, srRS, slSI, isIS, arEG, ukUA, zhCN, kuIQ, mnMN]
const { Option } = Select
const { RangePicker } = DatePicker
@ -144,7 +145,7 @@ describe('Locale Provider', () => {
},
{ sync: false }
)
const currentConfirmNode = document.querySelectorAll('.ant-confirm')[document.querySelectorAll('.ant-confirm').length - 1]
const currentConfirmNode = document.querySelectorAll('.ant-modal-confirm')[document.querySelectorAll('.ant-modal-confirm').length - 1]
let cancelButtonText = currentConfirmNode.querySelectorAll('.ant-btn:not(.ant-btn-primary) span')[0].innerHTML
let okButtonText = currentConfirmNode.querySelectorAll('.ant-btn-primary span')[0].innerHTML
if (locale.locale === 'zh-cn') {

1
components/locale-provider/default.js

@ -16,6 +16,7 @@ export default {
emptyText: 'No data',
selectAll: 'Select current page',
selectInvert: 'Invert current page',
sortTitle: 'Sort',
},
Modal: {
okText: 'OK',

5
components/locale-provider/it_IT.js

@ -10,12 +10,13 @@ export default {
TimePicker,
Calendar,
Table: {
filterTitle: 'Menu Filtro',
filterTitle: 'Menù Filtro',
filterConfirm: 'OK',
filterReset: 'Reset',
emptyText: 'Nessun dato',
selectAll: 'Seleziona pagina corrente',
selectInvert: 'Selezionare Inverti',
selectInvert: 'Inverti selezione nella pagina corrente',
sortTitle: 'Ordina',
},
Modal: {
okText: 'OK',

44
components/locale-provider/mn_MN.js

@ -0,0 +1,44 @@
import Pagination from '../vc-pagination/locale/mn_MN'
import DatePicker from '../date-picker/locale/mn_MN'
import TimePicker from '../time-picker/locale/mn_MN'
import Calendar from '../calendar/locale/mn_MN'
export default {
locale: 'mn-mn',
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: 'Хайх цэс',
filterConfirm: 'OK',
filterReset: 'Цэвэрлэх',
emptyText: 'Мэдээлэл байхгүй байна',
selectAll: 'Бүгдийг сонгох',
selectInvert: 'Бусдыг сонгох',
},
Modal: {
okText: 'OK',
cancelText: 'Цуцлах',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Цуцлах',
},
Transfer: {
notFoundContent: 'Олдсонгүй',
searchPlaceholder: 'Хайх',
itemUnit: 'Зүйл',
itemsUnit: 'Зүйлүүд',
},
Select: {
notFoundContent: 'Олдсонгүй',
},
Upload: {
uploading: 'Хуулж байна...',
removeFile: 'Файл устгах',
uploadError: 'Хуулахад алдаа гарлаа',
previewFile: 'Файлыг түргэн үзэх',
},
}

6
components/locale-provider/ru_RU.js

@ -28,7 +28,7 @@ export default {
},
Transfer: {
notFoundContent: 'Ничего не найдено',
searchPlaceholder: 'Введите название для поиска',
searchPlaceholder: 'Поиск',
itemUnit: 'элем.',
itemsUnit: 'элем.',
},
@ -36,9 +36,9 @@ export default {
notFoundContent: 'Ничего не найдено',
},
Upload: {
uploading: 'Закачиваю...',
uploading: 'Загрузка...',
removeFile: 'Удалить файл',
uploadError: 'Ошибка при закачке',
uploadError: 'При загрузке произошла ошибка',
previewFile: 'Предпросмотр файла',
},
}

1
components/locale-provider/zh_CN.js

@ -16,6 +16,7 @@ export default {
emptyText: '暂无数据',
selectAll: '全选当页',
selectInvert: '反选当页',
sortTitle: '排序',
},
Modal: {
okText: '确定',

Loading…
Cancel
Save