Giter VIP home page Giter VIP logo

Comments (5)

pfinkbeiner avatar pfinkbeiner commented on May 25, 2024 1

I made a Repository with the bare minimum. You can check it out here [email protected]:pfinkbeiner/nuxt3-vite-i18n-example.git

Try to clone it and see if it works on your machine. If so, compare the versions and configurations.

from bundle-tools.

pfinkbeiner avatar pfinkbeiner commented on May 25, 2024

Hm might be the wrong import.

import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'

instead of

import VueI18nPlugin from '@intlify/unplugin-vue-i18n'

Then you will most likely run into an issue with Internal server error: All collection items must start at the same column If so remove the plugin from additional vite config. Thats how I got it up and running.

// nuxt.config.ts
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'

export default defineNuxtConfig({
  devtools: { enabled: true },

  modules: [
    '@nuxtjs/i18n',
  ],
})

from bundle-tools.

MasatoHokotaDive avatar MasatoHokotaDive commented on May 25, 2024

I get the same error in both import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'and import VueI18nPlugin from '@intlify/unplugin-vue-i18n'. I think to need plugins key. I don't get an error the no plugins key, but the translation doesn't work.

// nuxt.config.ts
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'

export default defineNuxtConfig({
  devtools: { enabled: true },
  vite: {
    plugins: [
      VueI18nPlugin(),
    ],
  },
  modules: [
    '@nuxtjs/i18n',
  ],
})

and

// nuxt.config.ts
import VueI18nPlugin from '@intlify/unplugin-vue-i18n'

export default defineNuxtConfig({
  devtools: { enabled: true },
  vite: {
    plugins: [
      VueI18nPlugin.vite(),
    ],
  },
  modules: [
    '@nuxtjs/i18n',
  ],
})

from bundle-tools.

MasatoHokotaDive avatar MasatoHokotaDive commented on May 25, 2024

@pfinkbeiner I fixed it I use useI18n().t instead of $t and it solved the problem. Thank you.

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.