From 0b6c862f445916d443a6c04c61545192d7113c69 Mon Sep 17 00:00:00 2001 From: zazzaz Date: Thu, 19 Nov 2020 15:58:25 +0800 Subject: [PATCH] fix: correct locale name (#628) * fix: correct locale name * chore: update * fix: add name * fix: set correct dayjs locale * chore: update --- .github/pull_request_template.md | 2 +- packages/locale/index.ts | 4 ++ packages/locale/lang/{af-za.ts => af.ts} | 1 + packages/locale/lang/ar.ts | 1 + packages/locale/lang/bg.ts | 1 + packages/locale/lang/ca.ts | 1 + packages/locale/lang/{cs-cz.ts => cs.ts} | 1 + packages/locale/lang/da.ts | 1 + packages/locale/lang/de.ts | 1 + packages/locale/lang/el.ts | 1 + packages/locale/lang/en.ts | 1 + packages/locale/lang/eo.ts | 1 + packages/locale/lang/es.ts | 1 + packages/locale/lang/{ee.ts => et.ts} | 1 + packages/locale/lang/eu.ts | 1 + packages/locale/lang/fa.ts | 1 + packages/locale/lang/fi.ts | 1 + packages/locale/lang/fr.ts | 1 + packages/locale/lang/he.ts | 1 + packages/locale/lang/hr.ts | 1 + packages/locale/lang/hu.ts | 1 + packages/locale/lang/hy-am.ts | 1 + packages/locale/lang/id.ts | 1 + packages/locale/lang/it.ts | 1 + packages/locale/lang/ja.ts | 1 + packages/locale/lang/{kz.ts => kk.ts} | 1 + packages/locale/lang/km.ts | 1 + packages/locale/lang/ko.ts | 1 + packages/locale/lang/ku.ts | 1 + packages/locale/lang/{kg.ts => ky.ts} | 1 + packages/locale/lang/lt.ts | 1 + packages/locale/lang/lv.ts | 1 + packages/locale/lang/mn.ts | 1 + packages/locale/lang/nb-no.ts | 1 + packages/locale/lang/nl.ts | 1 + packages/locale/lang/pl.ts | 1 + packages/locale/lang/pt-br.ts | 1 + packages/locale/lang/pt.ts | 1 + packages/locale/lang/ro.ts | 1 + packages/locale/lang/{ru-ru.ts => ru.ts} | 1 + packages/locale/lang/sk.ts | 1 + packages/locale/lang/sl.ts | 1 + packages/locale/lang/sr.ts | 1 + packages/locale/lang/{sv-se.ts => sv.ts} | 1 + packages/locale/lang/ta.ts | 1 + packages/locale/lang/th.ts | 1 + packages/locale/lang/tk.ts | 1 + packages/locale/lang/{tr-tr.ts => tr.ts} | 1 + packages/locale/lang/ug-cn.ts | 1 + packages/locale/lang/{ua.ts => uk.ts} | 1 + packages/locale/lang/uz-uz.ts | 1 + packages/locale/lang/vi.ts | 1 + packages/locale/lang/zh-cn.ts | 1 + packages/locale/lang/zh-tw.ts | 1 + website/components/header.vue | 24 +++++------ website/docs/en-US/date-picker.md | 34 ++------------- website/docs/en-US/datetime-picker.md | 2 - website/docs/en-US/i18n.md | 20 ++++----- website/docs/en-US/time-picker.md | 2 - website/docs/es/date-picker.md | 30 ++----------- website/docs/es/datetime-picker.md | 2 - website/docs/es/i18n.md | 24 +++++------ website/docs/es/time-picker.md | 2 - website/docs/fr-FR/date-picker.md | 32 ++------------ website/docs/fr-FR/datetime-picker.md | 2 - website/docs/fr-FR/i18n.md | 20 ++++----- website/docs/fr-FR/time-picker.md | 2 - website/docs/jp/date-picker.md | 54 ++---------------------- website/docs/jp/datetime-picker.md | 2 - website/docs/jp/i18n.md | 22 +++++----- website/docs/jp/time-picker.md | 2 - website/docs/zh-CN/date-picker.md | 32 +++----------- website/docs/zh-CN/datetime-picker.md | 4 +- website/docs/zh-CN/i18n.md | 20 ++++----- website/docs/zh-CN/time-picker.md | 3 +- 75 files changed, 145 insertions(+), 248 deletions(-) rename packages/locale/lang/{af-za.ts => af.ts} (99%) rename packages/locale/lang/{cs-cz.ts => cs.ts} (99%) rename packages/locale/lang/{ee.ts => et.ts} (99%) rename packages/locale/lang/{kz.ts => kk.ts} (99%) rename packages/locale/lang/{kg.ts => ky.ts} (99%) rename packages/locale/lang/{ru-ru.ts => ru.ts} (99%) rename packages/locale/lang/{sv-se.ts => sv.ts} (99%) rename packages/locale/lang/{tr-tr.ts => tr.ts} (99%) rename packages/locale/lang/{ua.ts => uk.ts} (99%) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 478042e670eb8..5287e9d804be4 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,4 +2,4 @@ Please make sure these boxes are checked before submitting your PR, thank you! * [ ] Make sure you follow Element's contributing guide ([中文](https://github.com/element-plus/element-plus/blob/master/.github/CONTRIBUTING.zh-CN.md) | [English](https://github.com/element-plus/element-plus/blob/master/.github/CONTRIBUTING.en-US.md) | [Español](https://github.com/element-plus/element-plus/blob/master/.github/CONTRIBUTING.es.md) | [Français](https://github.com/element-plus/element-plus/blob/master/.github/CONTRIBUTING.fr-FR.md)). * [ ] Make sure you are merging your commits to `dev` branch. -* [ ] Add some descriptions and refer relative issues for you PR. +* [ ] Add some descriptions and refer to relative issues for your PR. diff --git a/packages/locale/index.ts b/packages/locale/index.ts index bd56d3c6dba7c..f6d174668a052 100644 --- a/packages/locale/index.ts +++ b/packages/locale/index.ts @@ -1,4 +1,5 @@ import defaultLang from './lang/en' +import dayjs from 'dayjs' let lang = defaultLang @@ -26,6 +27,9 @@ export const t = (path:string, option?): string => { export const use = (l): void => { lang = l || lang + if (lang.name) { + dayjs.locale(lang.name) + } } export default { use, t } diff --git a/packages/locale/lang/af-za.ts b/packages/locale/lang/af.ts similarity index 99% rename from packages/locale/lang/af-za.ts rename to packages/locale/lang/af.ts index 925f1297c8737..2ac13ec236000 100644 --- a/packages/locale/lang/af-za.ts +++ b/packages/locale/lang/af.ts @@ -1,4 +1,5 @@ export default { + name: 'af', el: { colorpicker: { confirm: 'Bevestig', diff --git a/packages/locale/lang/ar.ts b/packages/locale/lang/ar.ts index 7e736eacb3d78..b9aaa657f615e 100644 --- a/packages/locale/lang/ar.ts +++ b/packages/locale/lang/ar.ts @@ -1,4 +1,5 @@ export default { + name: 'ar', el: { colorpicker: { confirm: 'موافق', diff --git a/packages/locale/lang/bg.ts b/packages/locale/lang/bg.ts index 09df7882a8341..6a4215f737acd 100644 --- a/packages/locale/lang/bg.ts +++ b/packages/locale/lang/bg.ts @@ -1,4 +1,5 @@ export default { + name: 'bg', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/ca.ts b/packages/locale/lang/ca.ts index bf8681eb29159..926fde1899576 100644 --- a/packages/locale/lang/ca.ts +++ b/packages/locale/lang/ca.ts @@ -1,4 +1,5 @@ export default { + name: 'ca', el: { colorpicker: { confirm: 'Confirmar', diff --git a/packages/locale/lang/cs-cz.ts b/packages/locale/lang/cs.ts similarity index 99% rename from packages/locale/lang/cs-cz.ts rename to packages/locale/lang/cs.ts index 4e06ba0ad929b..59c37d7282d01 100644 --- a/packages/locale/lang/cs-cz.ts +++ b/packages/locale/lang/cs.ts @@ -1,4 +1,5 @@ export default { + name: 'cs', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/da.ts b/packages/locale/lang/da.ts index ffde873cc6bca..a7dcf40c8ed67 100644 --- a/packages/locale/lang/da.ts +++ b/packages/locale/lang/da.ts @@ -1,4 +1,5 @@ export default { + name: 'da', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/de.ts b/packages/locale/lang/de.ts index 7d347dc58a80e..8f21f2f01d7c2 100644 --- a/packages/locale/lang/de.ts +++ b/packages/locale/lang/de.ts @@ -1,4 +1,5 @@ export default { + name: 'de', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/el.ts b/packages/locale/lang/el.ts index 248671940b5e5..46eb5e73acc7a 100644 --- a/packages/locale/lang/el.ts +++ b/packages/locale/lang/el.ts @@ -1,4 +1,5 @@ export default { + name: 'el', el: { colorpicker: { confirm: 'Εντάξει', diff --git a/packages/locale/lang/en.ts b/packages/locale/lang/en.ts index a1f9a6dcb74d4..77b060cdc25f8 100644 --- a/packages/locale/lang/en.ts +++ b/packages/locale/lang/en.ts @@ -1,4 +1,5 @@ export default { + name: 'en', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/eo.ts b/packages/locale/lang/eo.ts index b0b7e3f9df2bf..1895c89465228 100644 --- a/packages/locale/lang/eo.ts +++ b/packages/locale/lang/eo.ts @@ -1,4 +1,5 @@ export default { + name: 'eo', el: { colorpicker: { confirm: 'Bone', diff --git a/packages/locale/lang/es.ts b/packages/locale/lang/es.ts index 1b24f1b7692eb..2bb66d96bfab4 100644 --- a/packages/locale/lang/es.ts +++ b/packages/locale/lang/es.ts @@ -1,4 +1,5 @@ export default { + name: 'es', el: { colorpicker: { confirm: 'Confirmar', diff --git a/packages/locale/lang/ee.ts b/packages/locale/lang/et.ts similarity index 99% rename from packages/locale/lang/ee.ts rename to packages/locale/lang/et.ts index 9aa030bdfa621..586e1fb0a2e5b 100644 --- a/packages/locale/lang/ee.ts +++ b/packages/locale/lang/et.ts @@ -1,4 +1,5 @@ export default { + name: 'et', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/eu.ts b/packages/locale/lang/eu.ts index b71d86fed8b9c..4d526b4727f0d 100644 --- a/packages/locale/lang/eu.ts +++ b/packages/locale/lang/eu.ts @@ -1,4 +1,5 @@ export default { + name: 'eu', el: { colorpicker: { confirm: 'Ados', diff --git a/packages/locale/lang/fa.ts b/packages/locale/lang/fa.ts index d5598645aee76..bad1881b55798 100644 --- a/packages/locale/lang/fa.ts +++ b/packages/locale/lang/fa.ts @@ -1,4 +1,5 @@ export default { + name: 'fa', el: { colorpicker: { confirm: 'باشد', diff --git a/packages/locale/lang/fi.ts b/packages/locale/lang/fi.ts index 749d92ce40462..7eeda8fa16b0d 100644 --- a/packages/locale/lang/fi.ts +++ b/packages/locale/lang/fi.ts @@ -1,4 +1,5 @@ export default { + name: 'fi', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/fr.ts b/packages/locale/lang/fr.ts index ffcd3afa663af..ab4460f2f8ade 100644 --- a/packages/locale/lang/fr.ts +++ b/packages/locale/lang/fr.ts @@ -1,4 +1,5 @@ export default { + name: 'fr', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/he.ts b/packages/locale/lang/he.ts index 56bf358b6b4a9..726ee62a425d4 100644 --- a/packages/locale/lang/he.ts +++ b/packages/locale/lang/he.ts @@ -1,4 +1,5 @@ export default { + name: 'he', el: { colorpicker: { confirm: 'אישור', diff --git a/packages/locale/lang/hr.ts b/packages/locale/lang/hr.ts index 1fb97a1798b73..b4565f5ae2642 100644 --- a/packages/locale/lang/hr.ts +++ b/packages/locale/lang/hr.ts @@ -1,4 +1,5 @@ export default { + name: 'hr', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/hu.ts b/packages/locale/lang/hu.ts index a5801edc5a644..1085001a6b03d 100644 --- a/packages/locale/lang/hu.ts +++ b/packages/locale/lang/hu.ts @@ -1,4 +1,5 @@ export default { + name: 'hu', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/hy-am.ts b/packages/locale/lang/hy-am.ts index 45fa63a1ce5b6..1a4f2e74c48e4 100644 --- a/packages/locale/lang/hy-am.ts +++ b/packages/locale/lang/hy-am.ts @@ -1,4 +1,5 @@ export default { + name: 'hy-am', el: { colorpicker: { confirm: 'Լաւ', diff --git a/packages/locale/lang/id.ts b/packages/locale/lang/id.ts index 1edaf9b7d128e..149f66f3bfb69 100644 --- a/packages/locale/lang/id.ts +++ b/packages/locale/lang/id.ts @@ -1,4 +1,5 @@ export default { + name: 'id', el: { colorpicker: { confirm: 'Pilih', diff --git a/packages/locale/lang/it.ts b/packages/locale/lang/it.ts index 4bc421849a152..166a7542bf8da 100644 --- a/packages/locale/lang/it.ts +++ b/packages/locale/lang/it.ts @@ -1,4 +1,5 @@ export default { + name: 'it', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/ja.ts b/packages/locale/lang/ja.ts index 123472ff4473b..bf0b151204aad 100644 --- a/packages/locale/lang/ja.ts +++ b/packages/locale/lang/ja.ts @@ -1,4 +1,5 @@ export default { + name: 'ja', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/kz.ts b/packages/locale/lang/kk.ts similarity index 99% rename from packages/locale/lang/kz.ts rename to packages/locale/lang/kk.ts index de7abd801bdd6..b5f435b1f86bb 100644 --- a/packages/locale/lang/kz.ts +++ b/packages/locale/lang/kk.ts @@ -1,4 +1,5 @@ export default { + name: 'kk', el: { colorpicker: { confirm: 'Қабылдау', diff --git a/packages/locale/lang/km.ts b/packages/locale/lang/km.ts index 62141cfa9fae0..8b979ee5649ba 100644 --- a/packages/locale/lang/km.ts +++ b/packages/locale/lang/km.ts @@ -1,4 +1,5 @@ export default { + name: 'km', el: { colorpicker: { confirm: 'យល់ព្រម', diff --git a/packages/locale/lang/ko.ts b/packages/locale/lang/ko.ts index b9fecb408004f..d020f026d74d6 100644 --- a/packages/locale/lang/ko.ts +++ b/packages/locale/lang/ko.ts @@ -1,4 +1,5 @@ export default { + name: 'ko', el: { colorpicker: { confirm: '확인', diff --git a/packages/locale/lang/ku.ts b/packages/locale/lang/ku.ts index 778227dc11271..f75f8c7e4ffee 100644 --- a/packages/locale/lang/ku.ts +++ b/packages/locale/lang/ku.ts @@ -1,4 +1,5 @@ export default { + name: 'ku', el: { colorpicker: { confirm: 'Temam', diff --git a/packages/locale/lang/kg.ts b/packages/locale/lang/ky.ts similarity index 99% rename from packages/locale/lang/kg.ts rename to packages/locale/lang/ky.ts index 02b996ac9430f..1780b12c4a001 100644 --- a/packages/locale/lang/kg.ts +++ b/packages/locale/lang/ky.ts @@ -1,4 +1,5 @@ export default { + name: 'ky', el: { colorpicker: { confirm: 'Мурунку', diff --git a/packages/locale/lang/lt.ts b/packages/locale/lang/lt.ts index 683052f3084bf..e77f0dd2bfde2 100644 --- a/packages/locale/lang/lt.ts +++ b/packages/locale/lang/lt.ts @@ -1,4 +1,5 @@ export default { + name: 'lt', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/lv.ts b/packages/locale/lang/lv.ts index 50f771fdd300b..ff674a02062b9 100644 --- a/packages/locale/lang/lv.ts +++ b/packages/locale/lang/lv.ts @@ -1,4 +1,5 @@ export default { + name: 'lv', el: { colorpicker: { confirm: 'Labi', diff --git a/packages/locale/lang/mn.ts b/packages/locale/lang/mn.ts index e8d8c8adcfffd..b12cb8c8b194b 100644 --- a/packages/locale/lang/mn.ts +++ b/packages/locale/lang/mn.ts @@ -1,4 +1,5 @@ export default { + name: 'mn', el: { colorpicker: { confirm: 'Тийм', diff --git a/packages/locale/lang/nb-no.ts b/packages/locale/lang/nb-no.ts index 557b3c18991c6..bae5eb6e81f12 100644 --- a/packages/locale/lang/nb-no.ts +++ b/packages/locale/lang/nb-no.ts @@ -1,4 +1,5 @@ export default { + name: 'nb-no', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/nl.ts b/packages/locale/lang/nl.ts index 6a5858c5170f5..94745b8168451 100644 --- a/packages/locale/lang/nl.ts +++ b/packages/locale/lang/nl.ts @@ -1,4 +1,5 @@ export default { + name: 'nl', el: { colorpicker: { confirm: 'Bevestig', diff --git a/packages/locale/lang/pl.ts b/packages/locale/lang/pl.ts index b35eb6e102f44..28197689a76a3 100644 --- a/packages/locale/lang/pl.ts +++ b/packages/locale/lang/pl.ts @@ -1,4 +1,5 @@ export default { + name: 'pl', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/pt-br.ts b/packages/locale/lang/pt-br.ts index 2864318a56b2b..43660a698f3e9 100644 --- a/packages/locale/lang/pt-br.ts +++ b/packages/locale/lang/pt-br.ts @@ -1,4 +1,5 @@ export default { + name: 'pt-br', el: { colorpicker: { confirm: 'Confirmar', diff --git a/packages/locale/lang/pt.ts b/packages/locale/lang/pt.ts index 15376ce4c55af..e54c5be6ce957 100644 --- a/packages/locale/lang/pt.ts +++ b/packages/locale/lang/pt.ts @@ -1,4 +1,5 @@ export default { + name: 'pt', el: { colorpicker: { confirm: 'Confirmar', diff --git a/packages/locale/lang/ro.ts b/packages/locale/lang/ro.ts index 6371a08391394..dbe9d0267b54f 100644 --- a/packages/locale/lang/ro.ts +++ b/packages/locale/lang/ro.ts @@ -1,4 +1,5 @@ export default { + name: 'ro', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/ru-ru.ts b/packages/locale/lang/ru.ts similarity index 99% rename from packages/locale/lang/ru-ru.ts rename to packages/locale/lang/ru.ts index a42c9eeedc9be..a22ee72d90f74 100644 --- a/packages/locale/lang/ru-ru.ts +++ b/packages/locale/lang/ru.ts @@ -1,4 +1,5 @@ export default { + name: 'ru', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/sk.ts b/packages/locale/lang/sk.ts index c8db1ba8fa419..6990b9afa8247 100644 --- a/packages/locale/lang/sk.ts +++ b/packages/locale/lang/sk.ts @@ -1,4 +1,5 @@ export default { + name: 'sk', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/sl.ts b/packages/locale/lang/sl.ts index 5888be5c7790c..f298463498148 100644 --- a/packages/locale/lang/sl.ts +++ b/packages/locale/lang/sl.ts @@ -1,4 +1,5 @@ export default { + name: 'sl', el: { colorpicker: { confirm: 'V redu', diff --git a/packages/locale/lang/sr.ts b/packages/locale/lang/sr.ts index 2a41dfbbb0c01..ebb4a180d53b0 100644 --- a/packages/locale/lang/sr.ts +++ b/packages/locale/lang/sr.ts @@ -1,4 +1,5 @@ export default { + name: 'sr', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/sv-se.ts b/packages/locale/lang/sv.ts similarity index 99% rename from packages/locale/lang/sv-se.ts rename to packages/locale/lang/sv.ts index 90062f3adc225..3b38d6d79fded 100644 --- a/packages/locale/lang/sv-se.ts +++ b/packages/locale/lang/sv.ts @@ -1,4 +1,5 @@ export default { + name: 'sv', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/ta.ts b/packages/locale/lang/ta.ts index 8b46b9a6c76fb..8a68d49a6aa2f 100644 --- a/packages/locale/lang/ta.ts +++ b/packages/locale/lang/ta.ts @@ -1,4 +1,5 @@ export default { + name: 'ta', el: { colorpicker: { confirm: 'உறுதி செய்', diff --git a/packages/locale/lang/th.ts b/packages/locale/lang/th.ts index 50dfbb013a7e2..1c1efb885a932 100644 --- a/packages/locale/lang/th.ts +++ b/packages/locale/lang/th.ts @@ -1,4 +1,5 @@ export default { + name: 'th', el: { colorpicker: { confirm: 'ตกลง', diff --git a/packages/locale/lang/tk.ts b/packages/locale/lang/tk.ts index 7f85517b2c4c0..c9ac2db961557 100644 --- a/packages/locale/lang/tk.ts +++ b/packages/locale/lang/tk.ts @@ -1,4 +1,5 @@ export default { + name: 'tk', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/tr-tr.ts b/packages/locale/lang/tr.ts similarity index 99% rename from packages/locale/lang/tr-tr.ts rename to packages/locale/lang/tr.ts index 3f4ae3dbe4f3e..bfdfaf59d8430 100644 --- a/packages/locale/lang/tr-tr.ts +++ b/packages/locale/lang/tr.ts @@ -1,4 +1,5 @@ export default { + name: 'tr', el: { colorpicker: { confirm: 'Onayla', diff --git a/packages/locale/lang/ug-cn.ts b/packages/locale/lang/ug-cn.ts index 211fd18110f38..51b0490df4b2d 100644 --- a/packages/locale/lang/ug-cn.ts +++ b/packages/locale/lang/ug-cn.ts @@ -1,4 +1,5 @@ export default { + name: 'ug-cn', el: { colorpicker: { confirm: 'جەزملەش', diff --git a/packages/locale/lang/ua.ts b/packages/locale/lang/uk.ts similarity index 99% rename from packages/locale/lang/ua.ts rename to packages/locale/lang/uk.ts index 69adaf9aac70f..6e5a6a76323fa 100644 --- a/packages/locale/lang/ua.ts +++ b/packages/locale/lang/uk.ts @@ -1,4 +1,5 @@ export default { + name: 'uk', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/uz-uz.ts b/packages/locale/lang/uz-uz.ts index 79ff4651b434b..24b43994f2c57 100644 --- a/packages/locale/lang/uz-uz.ts +++ b/packages/locale/lang/uz-uz.ts @@ -1,4 +1,5 @@ export default { + name: 'uz-uz', el: { colorpicker: { confirm: 'Qabul qilish', diff --git a/packages/locale/lang/vi.ts b/packages/locale/lang/vi.ts index 4382135fb643a..eb277803c0151 100644 --- a/packages/locale/lang/vi.ts +++ b/packages/locale/lang/vi.ts @@ -1,4 +1,5 @@ export default { + name: 'vi', el: { colorpicker: { confirm: 'OK', diff --git a/packages/locale/lang/zh-cn.ts b/packages/locale/lang/zh-cn.ts index dfcb9d8a0984b..e36acd12b872d 100644 --- a/packages/locale/lang/zh-cn.ts +++ b/packages/locale/lang/zh-cn.ts @@ -1,4 +1,5 @@ export default { + name: 'zh-cn', el: { colorpicker: { confirm: '确定', diff --git a/packages/locale/lang/zh-tw.ts b/packages/locale/lang/zh-tw.ts index 2d53d125648d8..94e7c2911e9df 100644 --- a/packages/locale/lang/zh-tw.ts +++ b/packages/locale/lang/zh-tw.ts @@ -1,4 +1,5 @@ export default { + name: 'zh-tw', el: { colorpicker: { confirm: '確認', diff --git a/website/components/header.vue b/website/components/header.vue index f587f6b92ce22..e199afa15423a 100644 --- a/website/components/header.vue +++ b/website/components/header.vue @@ -158,18 +158,18 @@ export default { }, }, created() { - const xhr = new XMLHttpRequest() - xhr.onreadystatechange = () => { - if (xhr.readyState === 4 && xhr.status === 200) { - const versions = JSON.parse(xhr.responseText) - this.versions = Object.keys(versions).reduce((prev, next) => { - prev[next] = versions[next] - return prev - }, {}) - } - } - xhr.open('GET', '/versions.json') - xhr.send() + // const xhr = new XMLHttpRequest() + // xhr.onreadystatechange = () => { + // if (xhr.readyState === 4 && xhr.status === 200) { + // const versions = JSON.parse(xhr.responseText) + // this.versions = Object.keys(versions).reduce((prev, next) => { + // prev[next] = versions[next] + // return prev + // }, {}) + // } + // } + // xhr.open('GET', '/versions.json') + // xhr.send() }, methods: { switchVersion(version) { diff --git a/website/docs/en-US/date-picker.md b/website/docs/en-US/date-picker.md index 873c474220cf9..489e0ca9a8cc3 100644 --- a/website/docs/en-US/date-picker.md +++ b/website/docs/en-US/date-picker.md @@ -310,38 +310,16 @@ If type is `daterange`, `default-value` sets the left side calendar. ::: ### Date Formats -Use `format` to control displayed text's format in the input box. Use `value-format` to control binding value's format. +Use `format` to control displayed text's format in the input box. -By default, the component accepts and emits a `Date` object. Below are supported format strings, using UTC 2017-01-02 03:04:05 as an example: +By default, the component accepts and emits a `Date` object. + +Check the list [here](https://day.js.org/docs/en/display/format#list-of-all-available-formats) of all available formats of Day.js. :::warning Pay attention to capitalization ::: -| format | meaning | note | example | -|------|------|------|------|------| -| `yyyy` | year | | 2017 | -| `M` | month | no leading 0 | 1 | -| `MM` | month | | 01 | -| `MMM` | month | | Jan | -| `MMMM` | month | | January | -| `W` | week | only for week picker's `format`; no leading 0 | 1 | -| `WW` | week | only for week picker's `format`| 01 | -| `d` | day | no leading 0 | 2 | -| `dd` | day | | 02 | -| `H` | hour | 24-hour clock; no leading 0 | 3 | -| `HH` | hour | 24-hour clock | 03 | -| `h` | hour | 12-hour clock; must be used with `A` or `a`; no leading 0 | 3 | -| `hh` | hour | 12-hour clock; must be used with `A` or `a` | 03 | -| `m` | minute | no leading 0 | 4 | -| `mm` | minute | | 04 | -| `s` | second | no leading 0 | 5 | -| `ss` | second | | 05 | -| `A` | AM/PM | only for `format`, uppercased | AM | -| `a` | am/pm | only for `format`, lowercased | am | -| `timestamp` | JS timestamp | only for `value-format`; binding value will be a `number` | 1483326245000 | -| `[MM]` | No escape characters | To escape characters, wrap them in square brackets (e.g. [A] [MM]) | MM | - :::demo ```html