mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-01 11:38:36 +08:00
feat: local add da_DK he_IL hu_HU id_ID ne-NP
This commit is contained in:
parent
b698d74fd0
commit
6a0f93486e
@ -1,9 +1,10 @@
|
||||
|
||||
import PropTypes from '../_util/vue-types'
|
||||
import defaultLocaleData from './default'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
componentName: PropTypes.string,
|
||||
componentName: PropTypes.string.def('global'),
|
||||
defaultLocale: PropTypes.oneOfType([
|
||||
PropTypes.object,
|
||||
PropTypes.func,
|
||||
@ -16,10 +17,12 @@ export default {
|
||||
methods: {
|
||||
getLocale () {
|
||||
const { componentName, defaultLocale } = this
|
||||
const locale = defaultLocale || defaultLocaleData[componentName || 'global']
|
||||
const { antLocale } = this.localeData
|
||||
const localeFromContext = antLocale && antLocale[componentName]
|
||||
|
||||
const localeFromContext = componentName && antLocale ? antLocale[componentName] : {}
|
||||
return {
|
||||
...(typeof defaultLocale === 'function' ? defaultLocale() : defaultLocale),
|
||||
...(typeof locale === 'function' ? locale() : locale),
|
||||
...(localeFromContext || {}),
|
||||
}
|
||||
},
|
||||
@ -29,7 +32,7 @@ export default {
|
||||
const localeCode = antLocale && antLocale.locale
|
||||
// Had use LocaleProvide but didn't set locale
|
||||
if (antLocale && antLocale.exist && !localeCode) {
|
||||
return 'en-us'
|
||||
return defaultLocaleData.locale
|
||||
}
|
||||
return localeCode
|
||||
},
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,45 +5,93 @@ import moment from 'moment'
|
||||
import MockDate from 'mockdate'
|
||||
import { LocaleProvider, Pagination, DatePicker, TimePicker, Calendar,
|
||||
Popconfirm, Table, Modal, Select, Transfer } from '../..'
|
||||
import arEG from '../ar_EG'
|
||||
import bgBG from '../bg_BG'
|
||||
import caES from '../ca_ES'
|
||||
import csCZ from '../cs_CZ'
|
||||
import daDK from '../da_DK'
|
||||
import deDE from '../de_DE'
|
||||
import elGR from '../el_GR'
|
||||
import enGB from '../en_GB'
|
||||
import frFR from '../fr_FR'
|
||||
import nlBE from '../nl_BE'
|
||||
import itIT from '../it_IT'
|
||||
import enUS from '../en_US'
|
||||
import esES from '../es_ES'
|
||||
import etEE from '../et_EE'
|
||||
import faIR from '../fa_IR'
|
||||
import fiFI from '../fi_FI'
|
||||
import frBE from '../fr_BE'
|
||||
import frFR from '../fr_FR'
|
||||
import heIL from '../he_IL'
|
||||
import huHU from '../hu_HU'
|
||||
import isIS from '../is_IS'
|
||||
import itIT from '../it_IT'
|
||||
import jaJP from '../ja_JP'
|
||||
import koKR from '../ko_KR'
|
||||
import kuIQ from '../ku_IQ'
|
||||
import mnMN from '../mn_MN'
|
||||
import nbNO from '../nb_NO'
|
||||
import neNP from '../ne-NP'
|
||||
import nlBE from '../nl_BE'
|
||||
import nlNL from '../nl_NL'
|
||||
import plPL from '../pl_PL'
|
||||
import ptBR from '../pt_BR'
|
||||
import ptPT from '../pt_PT'
|
||||
import ruRU from '../ru_RU'
|
||||
import esES from '../es_ES'
|
||||
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'
|
||||
import csCZ from '../cs_CZ'
|
||||
import koKR from '../ko_KR'
|
||||
import etEE from '../et_EE'
|
||||
import skSK from '../sk_SK'
|
||||
import jaJP from '../ja_JP'
|
||||
import trTR from '../tr_TR'
|
||||
import zhTW from '../zh_TW'
|
||||
import fiFI from '../fi_FI'
|
||||
import plPL from '../pl_PL'
|
||||
import bgBG from '../bg_BG'
|
||||
import viVN from '../vi_VN'
|
||||
import thTH from '../th_TH'
|
||||
import faIR from '../fa_IR'
|
||||
import elGR from '../el_GR'
|
||||
import nbNO from '../nb_NO'
|
||||
import srRS from '../sr_RS'
|
||||
import slSI from '../sl_SI'
|
||||
import isIS from '../is_IS'
|
||||
import arEG from '../ar_EG'
|
||||
import srRS from '../sr_RS'
|
||||
import svSE from '../sv_SE'
|
||||
import thTH from '../th_TH'
|
||||
import trTR from '../tr_TR'
|
||||
import ukUA from '../uk_UA'
|
||||
import viVN from '../vi_VN'
|
||||
import idID from '../id_ID'
|
||||
import zhCN from '../zh_CN'
|
||||
import kuIQ from '../ku_IQ'
|
||||
import mnMN from '../mn_MN'
|
||||
import zhTW from '../zh_TW'
|
||||
|
||||
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 locales = [
|
||||
arEG,
|
||||
bgBG,
|
||||
caES,
|
||||
csCZ,
|
||||
daDK,
|
||||
deDE,
|
||||
elGR,
|
||||
enGB,
|
||||
enUS,
|
||||
esES,
|
||||
etEE,
|
||||
faIR,
|
||||
fiFI,
|
||||
frBE,
|
||||
frFR,
|
||||
heIL,
|
||||
huHU,
|
||||
isIS,
|
||||
itIT,
|
||||
jaJP,
|
||||
koKR,
|
||||
kuIQ,
|
||||
mnMN,
|
||||
nbNO,
|
||||
neNP,
|
||||
nlBE,
|
||||
nlNL,
|
||||
plPL,
|
||||
ptBR,
|
||||
ptPT,
|
||||
ruRU,
|
||||
skSK,
|
||||
slSI,
|
||||
srRS,
|
||||
svSE,
|
||||
thTH,
|
||||
trTR,
|
||||
ukUA,
|
||||
viVN,
|
||||
idID,
|
||||
zhCN,
|
||||
zhTW,
|
||||
]
|
||||
|
||||
const { Option } = Select
|
||||
const { RangePicker } = DatePicker
|
||||
|
44
components/locale-provider/da_DK.js
Normal file
44
components/locale-provider/da_DK.js
Normal file
@ -0,0 +1,44 @@
|
||||
import Pagination from '../vc-pagination/locale/da_DK'
|
||||
import DatePicker from '../date-picker/locale/da_DK'
|
||||
import TimePicker from '../time-picker/locale/da_DK'
|
||||
import Calendar from '../calendar/locale/da_DK'
|
||||
|
||||
export default {
|
||||
locale: 'da',
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Pagination,
|
||||
Table: {
|
||||
filterTitle: 'Filtermenu',
|
||||
filterConfirm: 'OK',
|
||||
filterReset: 'Nulstil',
|
||||
emptyText: 'Ingen data',
|
||||
selectAll: 'Vælg alle',
|
||||
selectInvert: 'Inverter valg',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'OK',
|
||||
cancelText: 'Afbryd',
|
||||
justOkText: 'OK',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: 'OK',
|
||||
cancelText: 'Afbryd',
|
||||
},
|
||||
Transfer: {
|
||||
notFoundContent: 'Intet fundet',
|
||||
searchPlaceholder: 'Søg her',
|
||||
itemUnit: 'element',
|
||||
itemsUnit: 'elementer',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'Intet fundet',
|
||||
},
|
||||
Upload: {
|
||||
uploading: 'Uploader...',
|
||||
removeFile: 'Fjern fil',
|
||||
uploadError: 'Fejl ved upload',
|
||||
previewFile: 'Forhåndsvisning',
|
||||
},
|
||||
}
|
@ -9,6 +9,10 @@ export default {
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
// locales for all comoponents
|
||||
global: {
|
||||
placeholder: 'Please select',
|
||||
},
|
||||
Table: {
|
||||
filterTitle: 'Filter menu',
|
||||
filterConfirm: 'OK',
|
||||
|
@ -16,6 +16,7 @@ export default {
|
||||
emptyText: 'Ei kohteita',
|
||||
selectAll: 'Valitse kaikki',
|
||||
selectInvert: 'Valitse päinvastoin',
|
||||
sortTitle: 'Lajittele',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'OK',
|
||||
|
44
components/locale-provider/he_IL.js
Normal file
44
components/locale-provider/he_IL.js
Normal file
@ -0,0 +1,44 @@
|
||||
import Pagination from '../vc-pagination/locale/he_IL'
|
||||
import DatePicker from '../date-picker/locale/he_IL'
|
||||
import TimePicker from '../time-picker/locale/he_IL'
|
||||
import Calendar from '../calendar/locale/he_IL'
|
||||
|
||||
export default {
|
||||
locale: 'he',
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'תפריט סינון',
|
||||
filterConfirm: 'אישור',
|
||||
filterReset: 'איפוס',
|
||||
emptyText: 'אין מידע',
|
||||
selectAll: 'בחר הכל',
|
||||
selectInvert: 'הפוך בחירה',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'אישור',
|
||||
cancelText: 'ביטול',
|
||||
justOkText: 'אישור',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: 'אישור',
|
||||
cancelText: 'ביטול',
|
||||
},
|
||||
Transfer: {
|
||||
notFoundContent: 'לא נמצא',
|
||||
searchPlaceholder: 'חפש כאן',
|
||||
itemUnit: 'פריט',
|
||||
itemsUnit: 'פריטים',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'לא נמצא',
|
||||
},
|
||||
Upload: {
|
||||
uploading: 'מעלה...',
|
||||
removeFile: 'הסר קובץ',
|
||||
uploadError: 'שגיאת העלאה',
|
||||
previewFile: 'הצג קובץ',
|
||||
},
|
||||
}
|
45
components/locale-provider/hu_HU.js
Normal file
45
components/locale-provider/hu_HU.js
Normal file
@ -0,0 +1,45 @@
|
||||
import Pagination from '../vc-pagination/locale/hu_HU'
|
||||
import DatePicker from '../date-picker/locale/hu_HU'
|
||||
import TimePicker from '../time-picker/locale/hu_HU'
|
||||
import Calendar from '../calendar/locale/hu_HU'
|
||||
|
||||
export default {
|
||||
locale: 'hu',
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'Szűrők',
|
||||
filterConfirm: 'Alkalmazás',
|
||||
filterReset: 'Visszaállítás',
|
||||
emptyText: 'Nincs adat',
|
||||
selectAll: 'Jelenlegi oldal kiválasztása',
|
||||
selectInvert: 'Jelenlegi oldal inverze',
|
||||
sortTitle: 'Rendezés',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'Alkalmazás',
|
||||
cancelText: 'Visszavonás',
|
||||
justOkText: 'Alkalmazás',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: 'Alkalmazás',
|
||||
cancelText: 'Visszavonás',
|
||||
},
|
||||
Transfer: {
|
||||
notFoundContent: 'Nem található',
|
||||
searchPlaceholder: 'Keresés',
|
||||
itemUnit: 'elem',
|
||||
itemsUnit: 'elemek',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'Nem található',
|
||||
},
|
||||
Upload: {
|
||||
uploading: 'Feltöltés...',
|
||||
removeFile: 'Fájl eltávolítása',
|
||||
uploadError: 'Feltöltési hiba',
|
||||
previewFile: 'Fájl előnézet',
|
||||
},
|
||||
}
|
46
components/locale-provider/id_ID.js
Normal file
46
components/locale-provider/id_ID.js
Normal file
@ -0,0 +1,46 @@
|
||||
import Pagination from '../vc-pagination/locale/id_ID'
|
||||
import DatePicker from '../date-picker/locale/id_ID'
|
||||
import TimePicker from '../time-picker/locale/id_ID'
|
||||
import Calendar from '../calendar/locale/id_ID'
|
||||
|
||||
export default {
|
||||
locale: 'id',
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'Menu filter',
|
||||
filterConfirm: 'baik',
|
||||
filterReset: 'Setel ulang',
|
||||
emptyText: 'Tidak ada data',
|
||||
selectAll: 'Pilih halaman saat ini',
|
||||
selectInvert: 'Balikkan halaman saat ini',
|
||||
sortTitle: 'Menyortir',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'baik',
|
||||
cancelText: 'Membatalkan',
|
||||
justOkText: 'baik',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: 'baik',
|
||||
cancelText: 'Membatalkan',
|
||||
},
|
||||
Transfer: {
|
||||
titles: ['', ''],
|
||||
notFoundContent: 'Tidak ditemukan',
|
||||
searchPlaceholder: 'Cari di sini',
|
||||
itemUnit: 'barang',
|
||||
itemsUnit: 'item',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'Tidak ditemukan',
|
||||
},
|
||||
Upload: {
|
||||
uploading: 'Mengunggah...',
|
||||
removeFile: 'Hapus file',
|
||||
uploadError: 'Kesalahan pengunggahan',
|
||||
previewFile: 'File pratinjau',
|
||||
},
|
||||
}
|
@ -15,7 +15,10 @@
|
||||
</template>
|
||||
<script>
|
||||
import fr_FR from 'ant-design-vue/lib/locale-provider/fr_FR';
|
||||
import 'moment/locale/zh-cn';
|
||||
import moment from 'moment';
|
||||
import 'moment/locale/fr';
|
||||
|
||||
moment.locale('fr');
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -14,7 +14,10 @@ LocaleProvider 使用 Vue 的 [provide/inject](https://cn.vuejs.org/v2/api/#prov
|
||||
</template>
|
||||
<script>
|
||||
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
|
||||
import moment from 'moment';
|
||||
import 'moment/locale/zh-cn';
|
||||
|
||||
moment.locale('zh-cn');
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
45
components/locale-provider/ne-NP.js
Normal file
45
components/locale-provider/ne-NP.js
Normal file
@ -0,0 +1,45 @@
|
||||
import Pagination from '../vc-pagination/locale/en_US'
|
||||
import DatePicker from '../date-picker/locale/en_US'
|
||||
import TimePicker from '../time-picker/locale/en_US'
|
||||
import Calendar from '../calendar/locale/en_US'
|
||||
|
||||
export default {
|
||||
locale: 'ne-np',
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'फिल्टर मेनु',
|
||||
filterConfirm: 'हो',
|
||||
filterReset: 'रीसेट',
|
||||
emptyText: 'डाटा छैन',
|
||||
selectAll: 'सबै छान्नुुहोस्',
|
||||
selectInvert: 'छनौट उल्टाउनुहोस',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'हो',
|
||||
cancelText: 'होईन',
|
||||
justOkText: 'हो',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: 'हो',
|
||||
cancelText: 'होईन',
|
||||
},
|
||||
Transfer: {
|
||||
titles: ['', ''],
|
||||
notFoundContent: 'भेट्टिएन',
|
||||
searchPlaceholder: 'यहाँ खोज्नुहोस्',
|
||||
itemUnit: 'वस्तु',
|
||||
itemsUnit: 'वस्तुहरू',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'भेट्टिएन',
|
||||
},
|
||||
Upload: {
|
||||
uploading: 'अपलोड गर्दै...',
|
||||
removeFile: 'फाइल हटाउनुहोस्',
|
||||
uploadError: 'अप्लोडमा समस्या भयो',
|
||||
previewFile: 'फाइल पूर्वावलोकन गर्नुहोस्',
|
||||
},
|
||||
}
|
@ -9,6 +9,10 @@ export default {
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
// locales for all comoponents
|
||||
global: {
|
||||
placeholder: '请选择',
|
||||
},
|
||||
Table: {
|
||||
filterTitle: '筛选',
|
||||
filterConfirm: '确定',
|
||||
|
5
components/time-picker/locale/da_DK.js
Normal file
5
components/time-picker/locale/da_DK.js
Normal file
@ -0,0 +1,5 @@
|
||||
const locale = {
|
||||
placeholder: 'Vælg tid',
|
||||
}
|
||||
|
||||
export default locale
|
5
components/time-picker/locale/he_IL.js
Normal file
5
components/time-picker/locale/he_IL.js
Normal file
@ -0,0 +1,5 @@
|
||||
const locale = {
|
||||
placeholder: 'בחר שעה',
|
||||
}
|
||||
|
||||
export default locale
|
5
components/time-picker/locale/hu_HU.js
Normal file
5
components/time-picker/locale/hu_HU.js
Normal file
@ -0,0 +1,5 @@
|
||||
const locale = {
|
||||
placeholder: 'Válasszon időt',
|
||||
}
|
||||
|
||||
export default locale
|
5
components/time-picker/locale/id_ID.js
Normal file
5
components/time-picker/locale/id_ID.js
Normal file
@ -0,0 +1,5 @@
|
||||
const locale = {
|
||||
placeholder: 'Pilih waktu',
|
||||
}
|
||||
|
||||
export default locale
|
Loading…
Reference in New Issue
Block a user