vue-i18n
vue-i18n copied to clipboard
Interpolations in production mode does not work
Reporting a bug?
In dev mode, interpolation works as expected. Interpolation does not work in production mode.
In dev mode:

In prod mode:

translate:

template:

Expected behavior
In production, interpolation works the same way as in dev mode.

Reproduction
Create a quasar project with vue-i18n integration enabled. Install the latest version of vue-i18n (9.2.0-beta.37). Create a translation with named interpolation and build the project quasar build
System Info
System:
OS: Windows 10 10.0.19044
CPU: (12) x64 Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz
Memory: 42.90 GB / 63.84 GB
Binaries:
Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
npm: 8.9.0 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
Chrome: 103.0.5060.114
Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.49)
Internet Explorer: 11.0.19041.1566
Screenshot
No response
Additional context
No response
Validations
- [X] Read the Contributing Guidelines
- [X] Read the Documentation
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion
- [X] The provided reproduction is a minimal reproducible example of the bug.
quasarframework/quasar#13951
Need to add: runtimeOnly: false
vitePlugins: [
[
"@intlify/vite-plugin-vue-i18n",
{
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false`
// compositionOnly: false,
runtimeOnly: false,
// you need to set i18n resource including paths !
include: path.resolve(__dirname, "./src/i18n/**"),
},
],
],
We had the same issue and I can confirm that @gewisser's solution works.
Even better with runtimeOnly: ctx.dev as noted by @gewisser in https://github.com/quasarframework/quasar/issues/13951
close in activity