Giter Club home page Giter Club logo

Comments (5)

kazupon avatar kazupon commented on May 20, 2024 1

Is there any version of vite-plugin-vue-i18n that works with Vue 2?

Unfortunately, vite-plugin-vue-i18n is not supported for Vue 2. 😞
currently, you can migrate to Vue 3 ([email protected]) from Vue 2 ([email protected]) with vue-i18n-composable + Composition API, or @vue/compat

migration step for vue-i18n-composable + Composition API

  1. [email protected] + Vue 2
  2. [email protected] + @vue/composition-api + vue-composable + Vue 2 (migrate to Composition API from options API)
  3. [email protected] + Vue 3 (if you use vite, you can use vite-plugin-vue-i18n)

migration step for Options API

  1. [email protected] + Vue 2
  2. [email protected] (legacy mode) + @vue/compat
  3. [email protected] (legacy mode or Composition API mode) + Vue 3 (if you use vite, you can use vite-plugin-vue-i18n)

from bundle-tools.

kazupon avatar kazupon commented on May 20, 2024

Thank you for your reporting!
Unfortunately, I could not reproduce the same issue in my environment.

So, In order for us to find the cause, we need a repo to reproduce.
Could you give us a minimal reproduction environment, please?

npmPackages:
@intlify/vite-plugin-vue-i18n: ^2.4.0 => 2.4.0
@intlify/vue-i18n-loader: ^1.0.0 => 1.0.0
vite: ^2.4.4 => 2.4.4
vue: ^2.6.12 => 2.6.12
vue-i18n: ^9.1.7 => 9.1.7

I've found out some stuff from your npm packages that are installed in your environment.
[email protected] support for Vue 3 only.
I seem Vue 2.x is installed in your environment.
and, @intlify/vue-i18n-loader too.

I'm curious what your environment looks like.
It looks like you have a mix of environments built with Vue CLI and vite.
Once you have Vue 3, [email protected], vite and @intlify/vite-plugin-vue-i18n, so it’s installed with npm init vite@latest.
Could you please check if the same issue occurs in your environment?

from bundle-tools.

shadow-light avatar shadow-light commented on May 20, 2024

Yes was trying to migrate to vite from webpack and later discovered v9 isn't compatible with Vue2. No worries, I assume it might be due to the version mismatch. Someone can reopen if they encounter it too.

from bundle-tools.

shadow-light avatar shadow-light commented on May 20, 2024

@kazupon Is there any version of vite-plugin-vue-i18n that works with Vue 2?

I've got everything working except for i18n as messages are not loading from blocks like they were in Webpack. I instead get missing key errors.

(I've downgraded to vue-i18n 8.25.0 already)

from bundle-tools.

shadow-light avatar shadow-light commented on May 20, 2024

Thanks @kazupon for clarifying, no problem. I can't upgrade yet to Vue 3 due to other third-party dependencies. But I just moved all my <i18n> blocks into the JS section as an object instead which worked fine.

from bundle-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.