Skip to content

Commit

Permalink
fix: correct locale name (element-plus#628)
Browse files Browse the repository at this point in the history
* fix: correct locale name

* chore: update

* fix: add name

* fix: set correct dayjs locale

* chore: update
  • Loading branch information
zazzaz authored Nov 19, 2020
1 parent e7e2e79 commit 0b6c862
Show file tree
Hide file tree
Showing 75 changed files with 145 additions and 248 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 4 additions & 0 deletions packages/locale/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import defaultLang from './lang/en'
import dayjs from 'dayjs'

let lang = defaultLang

Expand Down Expand Up @@ -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 }
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'af',
el: {
colorpicker: {
confirm: 'Bevestig',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ar.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ar',
el: {
colorpicker: {
confirm: 'موافق',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/bg.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'bg',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ca.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ca',
el: {
colorpicker: {
confirm: 'Confirmar',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'cs',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/da.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'da',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/de.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'de',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/el.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'el',
el: {
colorpicker: {
confirm: 'Εντάξει',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/en.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'en',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/eo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'eo',
el: {
colorpicker: {
confirm: 'Bone',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/es.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'es',
el: {
colorpicker: {
confirm: 'Confirmar',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ee.ts → packages/locale/lang/et.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'et',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/eu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'eu',
el: {
colorpicker: {
confirm: 'Ados',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/fa.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'fa',
el: {
colorpicker: {
confirm: 'باشد',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/fi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'fi',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/fr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'fr',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/he.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'he',
el: {
colorpicker: {
confirm: 'אישור',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/hr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'hr',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/hu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'hu',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/hy-am.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'hy-am',
el: {
colorpicker: {
confirm: 'Լաւ',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/id.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'id',
el: {
colorpicker: {
confirm: 'Pilih',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/it.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'it',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ja.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ja',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/kz.ts → packages/locale/lang/kk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'kk',
el: {
colorpicker: {
confirm: 'Қабылдау',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/km.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'km',
el: {
colorpicker: {
confirm: 'យល់ព្រម',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ko.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ko',
el: {
colorpicker: {
confirm: '확인',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ku.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ku',
el: {
colorpicker: {
confirm: 'Temam',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/kg.ts → packages/locale/lang/ky.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ky',
el: {
colorpicker: {
confirm: 'Мурунку',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/lt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'lt',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/lv.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'lv',
el: {
colorpicker: {
confirm: 'Labi',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/mn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'mn',
el: {
colorpicker: {
confirm: 'Тийм',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/nb-no.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'nb-no',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/nl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'nl',
el: {
colorpicker: {
confirm: 'Bevestig',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/pl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'pl',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/pt-br.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'pt-br',
el: {
colorpicker: {
confirm: 'Confirmar',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/pt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'pt',
el: {
colorpicker: {
confirm: 'Confirmar',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ro.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ro',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ru',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/sk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'sk',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/sl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'sl',
el: {
colorpicker: {
confirm: 'V redu',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/sr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'sr',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'sv',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ta',
el: {
colorpicker: {
confirm: 'உறுதி செய்',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/th.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'th',
el: {
colorpicker: {
confirm: 'ตกลง',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/tk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'tk',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'tr',
el: {
colorpicker: {
confirm: 'Onayla',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ug-cn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'ug-cn',
el: {
colorpicker: {
confirm: 'جەزملەش',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/ua.ts → packages/locale/lang/uk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'uk',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/uz-uz.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'uz-uz',
el: {
colorpicker: {
confirm: 'Qabul qilish',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/vi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'vi',
el: {
colorpicker: {
confirm: 'OK',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/zh-cn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'zh-cn',
el: {
colorpicker: {
confirm: '确定',
Expand Down
1 change: 1 addition & 0 deletions packages/locale/lang/zh-tw.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
name: 'zh-tw',
el: {
colorpicker: {
confirm: '確認',
Expand Down
24 changes: 12 additions & 12 deletions website/components/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading

0 comments on commit 0b6c862

Please sign in to comment.