Skip to content

breaking(unplugin-vue-i18n): drop optimizeTranslationDirective option #467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
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
2 changes: 0 additions & 2 deletions e2e/vite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ describe('vite', () => {
expect(await getText(global.page, '#lang label')).toMatch('言語')
expect(await getText(global.page, '#fruits label')).toMatch('バナナが欲しい?')
expect(await getText(global.page, '#msg')).toMatch('こんにちは、世界!')
expect(await getText(global.page, '#custom-directive')).toMatch('やあ!')
})

test('change locale', async () => {
await global.page.selectOption('#lang select', 'en')
expect(await getText(global.page, '#lang label')).toMatch('Language')
expect(await getText(global.page, '#msg')).toMatch('hello, world!')
expect(await getText(global.page, '#custom-directive')).toMatch('Hi!')
})

test('change banana select', async () => {
Expand Down
1 change: 0 additions & 1 deletion examples/vite/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
</select>
</form>
<p id="msg">{{ t('hello') }}</p>
<p id="custom-directive" v-t="'hi'"></p>
<Banana />
<Apple />
</template>
Expand Down
13 changes: 0 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@
"typescript-eslint": "^8.26.1",
"vitest": "^3.0.8"
},
"pnpm": {
"overrides": {
"vue-i18n": "next",
"petite-vue-i18n": "next",
"@intlify/shared": "next",
"@intlify/core-base": "next",
"@intlify/message-compiler": "next",
"@intlify/vue-i18n-extensions>@intlify/shared": "next",
"@intlify/vue-i18n-extensions>@intlify/message-compiler": "next",
"@intlify/bundle-utils>@intlify/shared": "^12.0.0-alpha.2",
"@intlify/bundle-utils>@intlify/message-compiler": "^12.0.0-alpha.2"
}
},
"license": "MIT",
"prettier": "@kazupon/prettier-config",
"lint-staged": {
Expand Down
5 changes: 5 additions & 0 deletions packages/unplugin-vue-i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,11 @@ If do you will use this option, you need to enable `jitCompilation` option.

If you want to put it manually, you can specify the signature of the translation function as a string or a string array.

> [!IMPORTANT]
>
> `optimizeTranslationDirective` option is deprecated in v12, because `v-t` custom directive will be dropped in vue-i18n v12
> This option will be supported with unplugin-vue-i18n v6.x (vue-i18n until v11)

> [!WARNING]
> About for manually signature, see the details [vue-i18n-extensions API docs](https://github.com/intlify/vue-i18n-extensions/blob/next/docs/%40intlify/vue-i18n-extensions-api.md#translationsignatures) and [usecase from vue-i18n-extensions PR](https://github.com/intlify/vue-i18n-extensions/pull/217/files#diff-3fb9543f91e011d4b0dc9beff44082fe1a99c9eab70c1afab23c3c34352b7c38R121-R200)

Expand Down
8 changes: 2 additions & 6 deletions packages/unplugin-vue-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"url": "https://github.com/intlify/bundle-tools/issues"
},
"peerDependencies": {
"petite-vue-i18n": "*",
"petite-vue-i18n": "^12.0.0-alpha.2",
"vue": "^3.2.25",
"vue-i18n": "*"
"vue-i18n": "^12.0.0-alpha.2"
},
"peerDependenciesMeta": {
"petite-vue-i18n": {
Expand All @@ -24,13 +24,9 @@
}
},
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@intlify/bundle-utils": "workspace:*",
"@intlify/shared": "next",
"@intlify/vue-i18n-extensions": "^8.0.0",
"@rollup/pluginutils": "^5.1.0",
"@typescript-eslint/scope-manager": "^8.13.0",
"@typescript-eslint/typescript-estree": "^8.13.0",
"debug": "^4.3.3",
"defu": "^6.1.4",
"fast-glob": "^3.2.12",
Expand Down
Loading