Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ship.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ module.exports = {
`${releaseType} release v${version}`,
formatPullRequestTitle: ({ version, releaseType }) =>
`${releaseType} release v${version}`,
afterPublish: ({ exec, dir, version, releaseTag }) => {
exec(`yarn tag add vue-i18n@${version} next`)
},
shouldRelease: () => true,
releases: {
extractChangelog: ({ version, dir }) => {
Expand Down
12 changes: 6 additions & 6 deletions src/components/DatetimeFormat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, PropType } from 'vue'
import { RenderFunction, SetupContext } from 'vue'
import { useI18n } from '../i18n'
import { DateTimeOptions } from '../core'
import { Composer, ComposerInternal } from '../composer'
Expand Down Expand Up @@ -33,21 +33,21 @@ const DATETIME_FORMAT_KEYS = [
'timeZoneName'
]

export const DatetimeFormat = defineComponent({
export const DatetimeFormat = {
/* eslint-disable */
name: 'i18n-d',
props: {
...baseFormatProps,
value: {
type: [Number, Date] as PropType<number | Date>,
type: [Number, Date],
required: true
},
format: {
type: [String, Object] as PropType<Intl.DateTimeFormatOptions>
type: [String, Object]
}
},
/* eslint-enable */
setup(props, context) {
setup(props: DatetimeFormatProps, context: SetupContext): RenderFunction {
const i18n = useI18n({ useScope: 'parent' }) as Composer & ComposerInternal

return renderFormatter<
Expand All @@ -60,4 +60,4 @@ export const DatetimeFormat = defineComponent({
i18n.__datetimeParts(...args)
)
}
})
}
10 changes: 5 additions & 5 deletions src/components/NumberFormat.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, PropType } from 'vue'
import { SetupContext, RenderFunction } from 'vue'
import { useI18n } from '../i18n'
import { NumberOptions } from '../core'
import { Composer, ComposerInternal } from '../composer'
Expand Down Expand Up @@ -28,7 +28,7 @@ const NUMBER_FORMAT_KEYS = [
'formatMatcher'
]

export const NumberFormat = defineComponent({
export const NumberFormat = {
/* eslint-disable */
name: 'i18n-n',
props: {
Expand All @@ -38,11 +38,11 @@ export const NumberFormat = defineComponent({
required: true
},
format: {
type: [String, Object] as PropType<Intl.NumberFormatOptions>
type: [String, Object]
}
},
/* eslint-enable */
setup(props, context) {
setup(props: NumberFormatProps, context: SetupContext): RenderFunction {
const i18n = useI18n({ useScope: 'parent' }) as Composer & ComposerInternal

return renderFormatter<
Expand All @@ -55,4 +55,4 @@ export const NumberFormat = defineComponent({
i18n.__numberParts(...args)
)
}
})
}
8 changes: 4 additions & 4 deletions src/components/Translation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { h, Fragment, defineComponent, SetupContext, VNodeChild } from 'vue'
import { h, Fragment, SetupContext, VNodeChild, RenderFunction } from 'vue'
import { Composer, ComposerInternal } from '../composer'
import { useI18n } from '../i18n'
import { TranslateOptions } from '../core'
Expand All @@ -11,7 +11,7 @@ export interface TranslationProps extends BaseFormatProps {
plural?: number | string
}

export const Translation = defineComponent({
export const Translation = {
/* eslint-disable */
name: 'i18n-t',
props: {
Expand All @@ -27,7 +27,7 @@ export const Translation = defineComponent({
}
},
/* eslint-enable */
setup(props, context) {
setup(props: TranslationProps, context: SetupContext): RenderFunction {
const { slots, attrs } = context
const i18n = useI18n({ useScope: props.scope }) as Composer &
ComposerInternal
Expand All @@ -51,7 +51,7 @@ export const Translation = defineComponent({
: h(Fragment, { ...attrs }, children)
}
}
})
}

function getInterpolateArg(
{ slots }: SetupContext,
Expand Down
5 changes: 2 additions & 3 deletions src/components/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PropType } from 'vue'
import { Locale } from '../core'
import { I18nScope } from '../i18n'

Expand All @@ -12,13 +11,13 @@ export interface BaseFormatProps {

export const baseFormatProps = {
tag: {
type: [String, Object] as PropType<string | object>
type: [String, Object]
},
locale: {
type: String
},
scope: {
type: String as PropType<ComponetI18nScope>,
type: String,
validator: (val: ComponetI18nScope): boolean =>
val === 'parent' || val === 'global',
default: 'parent' as ComponetI18nScope
Expand Down
8 changes: 4 additions & 4 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from 'vue'
import { App, Component } from 'vue'
import { I18nSymbol, I18n } from './i18n'
import { Translation, NumberFormat, DatetimeFormat } from './components'
import { vTDirective } from './directive'
Expand Down Expand Up @@ -41,10 +41,10 @@ export function apply<Messages, DateTimeFormats, NumberFormats>(
// install components
app.component(
!useI18nComponentName ? Translation.name : 'i18n',
Translation
Translation as Component
)
app.component(NumberFormat.name, NumberFormat)
app.component(DatetimeFormat.name, DatetimeFormat)
app.component(NumberFormat.name, NumberFormat as Component)
app.component(DatetimeFormat.name, DatetimeFormat as Component)
}

// install directive
Expand Down
120 changes: 60 additions & 60 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -608,11 +608,11 @@
universal-user-agent "^6.0.0"

"@octokit/plugin-paginate-rest@^2.2.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.3.0.tgz#7d1073e56cfd15d3f99dcfe81fa5d2b466f3a6f6"
integrity sha512-Ye2ZJreP0ZlqJQz8fz+hXvrEAEYK4ay7br1eDpWzr6j76VXs/gKqxFcH8qRzkB3fo/2xh4Vy9VtGii4ZDc9qlA==
version "2.3.1"
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.3.1.tgz#00f91701dfda26227c3e748d42bc89e2d0d9ce55"
integrity sha512-81A+ONLpcSX7vWxnEmVZteQPNsbdeScSVUqjgMYPSk1trzG69iYkhS42wPRWtN0nYw6OEmT48DNeQCjHeyroYw==
dependencies:
"@octokit/types" "^5.2.0"
"@octokit/types" "^5.3.0"

"@octokit/plugin-request-log@^1.0.0":
version "1.0.0"
Expand Down Expand Up @@ -667,7 +667,7 @@
dependencies:
"@types/node" ">= 8"

"@octokit/types@^5.0.0", "@octokit/types@^5.0.1", "@octokit/types@^5.2.0":
"@octokit/types@^5.0.0", "@octokit/types@^5.0.1", "@octokit/types@^5.3.0":
version "5.4.1"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.4.1.tgz#d5d5f2b70ffc0e3f89467c3db749fa87fc3b7031"
integrity sha512-OlMlSySBJoJ6uozkr/i03nO5dlYQyE05vmQNZhAh9MyO4DPBP88QlwsDVLmVjIMFssvIZB6WO0ctIGMRG+xsJQ==
Expand Down Expand Up @@ -1012,69 +1012,69 @@
dependencies:
eslint-visitor-keys "^1.1.0"

"@vue/compiler-core@3.0.0-rc.8":
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.0-rc.8.tgz#c8a630b440d03a1790d34b3c5a7b3c86caa8a84e"
integrity sha512-67sHKlKhrBhxF72gJc8PkJeAA1iZ4x1krVDuS2yOvS44Gj+fNHu8Y25mThLu+eq2rXCUrrbbmZge9ND6VuyFUA==
"@vue/compiler-core@3.0.0-rc.9":
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.0-rc.9.tgz#f2baef360dec3630a230a056dde1e76c9c7bb5f5"
integrity sha512-/Ns7KGT5P0wh4JTM91drBmNIiBlKrCFUqIE2vk8dmaVvqEJf1mqympz1CDZpikghCQC6hKu3tYKxA7qtcMRazw==
dependencies:
"@babel/parser" "^7.10.4"
"@babel/types" "^7.10.4"
"@vue/shared" "3.0.0-rc.8"
"@vue/shared" "3.0.0-rc.9"
estree-walker "^2.0.1"
source-map "^0.6.1"

"@vue/compiler-dom@3.0.0-rc.8":
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.0-rc.8.tgz#a4fd66356e1dbe7bf3f3e41f6034e682b7c22b3d"
integrity sha512-xnYswIMWTu8ck5ZcyXrZBhB/gBXla5JpfdEkoPqjNNSXZn1w6N398KuB6UQtjSDjjIsZ7shs7/x5hgtnqTNBJQ==
"@vue/compiler-dom@3.0.0-rc.9":
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.0-rc.9.tgz#2a122181db498c0605213fe541af24ecb03ef27e"
integrity sha512-0hCnrIxwp0TKVXKnGYFztM4LMUvFpfXW7YoEglvHqIfZsGkyKcnCYDx4FPk1frDM21xnrr5HgcHt42rlz8lDBA==
dependencies:
"@vue/compiler-core" "3.0.0-rc.8"
"@vue/shared" "3.0.0-rc.8"
"@vue/compiler-core" "3.0.0-rc.9"
"@vue/shared" "3.0.0-rc.9"

"@vue/compiler-ssr@3.0.0-rc.8":
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.0.0-rc.8.tgz#4b6137922ede1c6abca74e15fda8baf7163e14e0"
integrity sha512-0NtZ6e90CpD/MJRDY0AgGNA1t3utjMkg1A/xc2RruUvJgpCsr/9sj6wK0ZoXV/MKKKFzE5DVgPjwVs0o5wxTfg==
"@vue/compiler-ssr@3.0.0-rc.9":
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.0.0-rc.9.tgz#52e4523b54d993ca0ad137813c5b1212988e62af"
integrity sha512-lpbnkJrhkI5QgprLPXcB1Uq402QiibPFKRUQZ5vu3zeAvUeMYuQUtZS/Dslurcvqd1dbBC/HM0gCpLtjEQ+2qA==
dependencies:
"@vue/compiler-dom" "3.0.0-rc.8"
"@vue/shared" "3.0.0-rc.8"
"@vue/compiler-dom" "3.0.0-rc.9"
"@vue/shared" "3.0.0-rc.9"

"@vue/reactivity@3.0.0-rc.8":
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.0-rc.8.tgz#329a00e63781663516e5b356ab17e4782bafa7d6"
integrity sha512-/NjP+CI3ggeRXaIlJCI/zJBuClOhwy+SPvt8mcIQEMeewn67bh1Qzl5iqD+yFFzaS3MR3ofdkcCiq1UQ/k2Omg==
"@vue/reactivity@3.0.0-rc.9":
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.0-rc.9.tgz#d6a3f40bb9c2e3b0f6f20b4693efc2f91d0c220b"
integrity sha512-1fJSt4zZ/icZUNsN3Te5BeVChmQ7Ner2xUYy9ALtShLSj2RwxRVhtysjXxLE16TbwLkHjsOHjA8tQWrdBfQG0A==
dependencies:
"@vue/shared" "3.0.0-rc.8"
"@vue/shared" "3.0.0-rc.9"

"@vue/runtime-core@3.0.0-rc.8":
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.0-rc.8.tgz#3672094478c7dcf84e6906ac6f0c20fe386fcf9c"
integrity sha512-VZpfCqsjz9rixDWCrEB4aI2qjlTslxAlK+5lVK+4jq7Tz2ZLQa93/Zg9p5DRzdI5GCd3nkOxo9hFXkPu+B2pIw==
"@vue/runtime-core@3.0.0-rc.9":
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.0-rc.9.tgz#5b4872363c69df6db4e937678ebdc68a141960bb"
integrity sha512-5tViEzPl8K1moMjCQJXqvTa/RjR/h8cZ9dUDgKfKWvZhxAmXHtmYlBWrvEeFTGWiEuZj0XlZkNxMNjuHLVF0Vg==
dependencies:
"@vue/reactivity" "3.0.0-rc.8"
"@vue/shared" "3.0.0-rc.8"
"@vue/reactivity" "3.0.0-rc.9"
"@vue/shared" "3.0.0-rc.9"

"@vue/runtime-dom@3.0.0-rc.8":
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.0-rc.8.tgz#96bde809e1d49ff0655bc63e7852cdaa25b23a8e"
integrity sha512-Da1wMDU1bh1c5WLSc3E78ns3XphZG4WHl6v0elhFkwpnSF5qB14ZYnuuqXVZ4N8Afe6ZjvtM4GSWOZlD4TkYng==
"@vue/runtime-dom@3.0.0-rc.9":
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.0-rc.9.tgz#6673901830c78cbe0b7c7c3f656db6ba49783dd1"
integrity sha512-OUKFLOaoshmQPaW7iaYuxl9ip3v08g8cXYr0bu68/0r94PF2/xO/b0GhoUoyeqp/pu1VzZ1TxulJ94JOXsuYjg==
dependencies:
"@vue/runtime-core" "3.0.0-rc.8"
"@vue/shared" "3.0.0-rc.8"
"@vue/runtime-core" "3.0.0-rc.9"
"@vue/shared" "3.0.0-rc.9"
csstype "^2.6.8"

"@vue/server-renderer@^3.0.0-rc.8":
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.0.0-rc.8.tgz#e8090f7470e485f42a05b66707ae60b45a2316aa"
integrity sha512-OHMDMQobmnX+DbwE694WQwx0vkmzjegkyRS38DlwzffmK1IvyHbWeuwhNV0itXl0Llzdgp2E4pSBoZtJkQW+tg==
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.0.0-rc.9.tgz#c8c17573f94344e78865928296b5b95016fd24a9"
integrity sha512-GT7I6a2WOW1YTrmUXRbI6dJkKeV3vuiJ6Z22M70K6d6ekLM0o8CqHTJYqtiKNeoZdfhHinewlT0xelDgIDMb9g==
dependencies:
"@vue/compiler-ssr" "3.0.0-rc.8"
"@vue/shared" "3.0.0-rc.8"
"@vue/compiler-ssr" "3.0.0-rc.9"
"@vue/shared" "3.0.0-rc.9"

"@vue/shared@3.0.0-rc.8":
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.0-rc.8.tgz#d6b80e14c202c37d9f1953965a1517eab46c1d3b"
integrity sha512-GSvG6mbDcOQtLKfeNe77ds0oo5PRfTDhsPlqx1fwvpyROS/BAOo1YK17CXwmI+Vsf+51L/l42tTneBTdhQotmg==
"@vue/shared@3.0.0-rc.9":
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.0-rc.9.tgz#81e71c2c40dbbfc4f05b3b4a3f92cb2842864aa3"
integrity sha512-SHD7qwziiG6208nKrs0qqbWbYckvBiCBCLwlRjUb6NEDUMN0TOVyzyaTvdnHND9ion/ZMdwEKMtWWtgJJkHDdw==

JSONStream@^1.0.4:
version "1.3.5"
Expand Down Expand Up @@ -2626,9 +2626,9 @@ eslint-plugin-vue@^7.0.0-beta.2:
vue-eslint-parser "^7.1.0"

eslint-rule-docs@^1.1.5:
version "1.1.205"
resolved "https://registry.yarnpkg.com/eslint-rule-docs/-/eslint-rule-docs-1.1.205.tgz#05df8791c5941d6831b6f181bc88629b46ec3dce"
integrity sha512-yguHHAkBG9L09YoaOpXXi3MsvEwPlqhas8yDnnaykbA6I8BAxUpa3FkCspxyzdnDPuLWEy+vVmrZHXL2M4zFTQ==
version "1.1.206"
resolved "https://registry.yarnpkg.com/eslint-rule-docs/-/eslint-rule-docs-1.1.206.tgz#bdbe29583467f3a39362dd3f8c9c166bdbce6741"
integrity sha512-xEHu3DuY/3rAhyp6Hg3zrMWvpNYE7ez3DaV7ywlLBmqaybnjbYtZnU7b+xY5V3sjPwhqrj27sqjM0vxkFIBEWg==

eslint-scope@^4.0.0:
version "4.0.3"
Expand Down Expand Up @@ -5150,9 +5150,9 @@ minipass-collect@^1.0.2:
minipass "^3.0.0"

minipass-fetch@^1.1.2:
version "1.3.0"
resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.3.0.tgz#110fed67fedd02dbeab823489ff0453f84fa5a6c"
integrity sha512-Yb23ESZZ/8QxiBvSpJ4atbVMVDx2CXrerzrtQzQ67eLqKg+zFIkYFTagk3xh6fdo+e/FvDtVuCD4QcuYDRR3hw==
version "1.3.1"
resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.3.1.tgz#6d09556764474119ed79e270bc98b9c76d12c8e2"
integrity sha512-N0ddPAD8OZnoAHUYj1ZH4ZJVna+ucy7if777LrdeIV1ko8f46af4jbyM5EC1gN4xc9Wq5c3C38GnxRJ2gneXRA==
dependencies:
minipass "^3.1.0"
minipass-sized "^1.0.3"
Expand Down Expand Up @@ -7546,13 +7546,13 @@ vue-eslint-parser@^7.1.0:
lodash "^4.17.15"

vue@^3.0.0-rc.8:
version "3.0.0-rc.8"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.0-rc.8.tgz#001b9d7a4033d6ff4b601c6457fc080e192fead9"
integrity sha512-2TPckyMoOjEawJBsjb+02GusPBBTwgCqGSjQYsJnToCPDR7PnVCkA4dbGJYlw1w9heXfwgyI+9qmZT0vMVLGmg==
version "3.0.0-rc.9"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.0-rc.9.tgz#8c54e6168625e3533f1f764ad3fa89235b01afb3"
integrity sha512-bimvpl5q/sKy1dAOE+KNX9T3p6Qq8kuNRmOYwaxtacI91ksjS7nVGse1FANhTL+XTQgl8+ySrd3f67xWi26nxw==
dependencies:
"@vue/compiler-dom" "3.0.0-rc.8"
"@vue/runtime-dom" "3.0.0-rc.8"
"@vue/shared" "3.0.0-rc.8"
"@vue/compiler-dom" "3.0.0-rc.9"
"@vue/runtime-dom" "3.0.0-rc.9"
"@vue/shared" "3.0.0-rc.9"

w3c-hr-time@^1.0.2:
version "1.0.2"
Expand Down