i18n icon indicating copy to clipboard operation
i18n copied to clipboard

Change the locale Vuetify with nuxt-i18n

Open berenicestr opened this issue 7 years ago • 3 comments

Hi,

I have a problem. I am using the new Nuxt-vuetify module @kevinmarrec https://github.com/nuxt-community/vuetify-module and also I use Nuxt-i18n to internationalization.

But now there is some Vuetify components (p.e. Data Dable) that I have to configure the internationalisation too. https://vuetifyjs.com/en/customization/internationalization

I don't know how can I sincronize. I have this in my nuxt.config.js

import es from 'vuetify/es5/locale/es'; import en from 'vuetify/es5/locale/en' const I18N = require('./config')

modules: [ "@nuxtjs/vuetify", ['nuxt-i18n', I18N] ] ....

// Doc: https://github.com/nuxt-community/vuetify-module vuetify: { lang: { locales: { es , en }, current: 'es', } }

I don't know hot to sincronize when I change the locale in the Nuxt switcher with the Vuetify locale.

Thanks in advance for the help, Regards

This question is available on Nuxt community (#c298)

berenicestr avatar Sep 05 '19 17:09 berenicestr

This issue as been imported as question since it does not respect nuxt-i18n issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/nuxt-i18n/issues/c298.

ghost avatar Sep 05 '19 17:09 ghost

Seems like vuetify integrates with vue-i18n which this module uses. So if you just include your vuetify strings in your strings under the $vuetify key and add a special language function for vutify (that's something for vuetify-module to do probably) then it should just work - see https://vuetifyjs.com/en/customization/internationalization#vue-i-18-n

rchl avatar Sep 05 '19 17:09 rchl

Your english file should be like this:

import en from "vuetify/es5/locale/en";

export default {
    $vuetify: en,
    Hello: "Hello, it's me, Juanman",
};

JuanmanDev avatar Jun 05 '20 12:06 JuanmanDev