vue-i18n icon indicating copy to clipboard operation
vue-i18n copied to clipboard

Interpolations in production mode does not work

Open gewisser opened this issue 3 years ago • 10 comments
trafficstars

Reporting a bug?

In dev mode, interpolation works as expected. Interpolation does not work in production mode.

In dev mode: image

In prod mode:

image

translate:

image

template:

image

Expected behavior

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

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

quasarframework/quasar#13951

gewisser avatar Jul 13 '22 13:07 gewisser

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/**"),
          },
        ],
      ],

gewisser avatar Jul 14 '22 07:07 gewisser

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

tofi86 avatar Jul 25 '22 08:07 tofi86

close in activity

kazupon avatar Nov 15 '22 17:11 kazupon