Questions tagged [vue-i18n]

Use when referencing the vue-i18n plugin for Vue.js

Internationalization plugin for Vue.js.

Github Documentation

567 questions
5
votes
1 answer

Vue3 - i18n - You are running the esm-bundler build of vue-i18n

I have just started a new project with Vue3 and added vue-i18n version 9 (https://vue-i18n.intlify.dev/guide/) I have set up, but I can't change the language. It's doing the trasnlation since it's changing the {{ $t('message.value') }} to the proper…
Bernardao
  • 466
  • 6
  • 23
5
votes
2 answers

vue-i18n-next disable console warning

How to disable console warning like this : Not found '21.11.2021' key in 'finnish' locale messages vue-i18n version is "9.0.0-beta.6". I am trying silentTranslationWarn: true const i18n = createI18n({ messages: { en, finnish }, …
Denys
  • 283
  • 2
  • 11
5
votes
2 answers

Vue.js 3 - Error while using Vue I18n plugin in vue - Cannot set property '_vm' of undefined

I've just started working with Vue.js and learning it through some online code snippet and tutorials. I'm trying to implement internationalization support for my vue project, but I'm getting error in web-console. Here are my code…
Omar Bahir
  • 1,237
  • 5
  • 20
  • 48
5
votes
1 answer

How to use $t from vue-i18n inside Vuex store to initialize static strings

In my vuex store module I have provinceData to supply as datasource for Vuetify dropdown selection box. provinceData: [ {value:"AB", text: "Alberta"}, {value:"BC", text: "British Columbia"}, ... ], I can…
AlexeiP
  • 581
  • 1
  • 10
  • 26
5
votes
2 answers

How to integrate VeeValidate with vue-i18n?

With a click event i change the vue-i18n language i want to change the vee-validate dictionary to the same language main.js import VeeValidate from 'vee-validate' import validations from './validations.js' import i18n from…
Alex Hunter
  • 212
  • 9
  • 30
5
votes
1 answer

Vue-i18n - npm run serve fails with error TypeError: Cannot read property 'i18n' of undefined

I implemented my vue application with i18n and it worked all fine yesterday. But when I tried to start my application today I got the error which you can see in the title. I can give the following stack trace: TypeError: Cannot read property 'i18n'…
Lars
  • 53
  • 1
  • 4
5
votes
2 answers

How to get the current locale in Vue i18n plugin?

I tried with this.$i18n.locale but that only gives me the browser's locale, not the current language being used (I have a default local fallback) Something like this.$i18n.currentLanguage doesn't seem to exist
germi
  • 95
  • 5
5
votes
2 answers

nuxt i18n routing not working for sub pages

I have changed my app to make it work with nuxt i18n and the translation seems to work when I access the routes directly. E.g. http://localhost:3000/fr/step/1 I have the following structure in my app and each step is one page with different…
grindking
  • 917
  • 5
  • 13
  • 29
5
votes
2 answers

Prefix routes with locale in vue.js (using vue-i18n)

I have a locale.js file which is responsible for defining user locale. Here it is: import store from '@/vuex/index' let locale const defaultLocale = 'en_US' if (store.getters['auth/authenticated']) { locale =…
Victor
  • 5,073
  • 15
  • 68
  • 120
4
votes
1 answer

Why my fresh vue3 project generated with Vue-cli in Typescript with vue-cli-i18n isn't working out of the box?

I hope you can help me. I'm new on vue/i18n and others, so sorry if the response is simple or already exists where else, but I didn't find it ...... I try to generate a new project using vue-cli and vue-cli-plugin-i18n but the resulting source code…
BanZZai
  • 43
  • 4
4
votes
0 answers

How to use "useI18n" on "server/api" directory

I'm using @nuxtjs/i18n version ^8.0.0-beta.7 and here is my nuxt.config.ts: import en from "./locales/en.json"; export default defineNuxtConfig({ typescript: { strict: true, shim: false }, components: true, runtimeConfig: { //... }, …
Yume
  • 73
  • 5
4
votes
1 answer

VueJS i18n - How to change the variable prefix in translation files

I'm doing an app using Laravel inertia and Vue, we wanted to add i18n to the app and use the same translation files for both laravel and i18n, the problem is the variable interpolation, laravel by default use :variable but vue i18n use {variable} I…
4
votes
1 answer

Quasar vue-i18n-loader Error: Final Loader didn't return a Buffer or String

I am using the Quasar Framework for my App and recently tried to update to v3.0.3 (containing Vue3). I followed their doc on the i18n plugin https://quasar.dev/options/app-internationalization. vue-i18n itself seems to be working fine but the…
4
votes
1 answer

Storybook: how to update i18 locale depending on globals

I try to migrate from @storybook/addon-knobs to @storybook/addon-controls and I've got an issue. I have a knob that I use to update i18n locale. It also switch from rtl to ltr. It works flawlessly: import { select } from…
Amaury Hanser
  • 3,191
  • 12
  • 30
4
votes
1 answer

How can I manage to just load the language files I really need with vue-i18n?

With vue-i18n it is pretty easy to translate your Vue.js App. But as your project grows you don't want to load ALL messages in ALL languages. Most users never switch the language. We have separate domains for each language and switching the language…
Janning Vygen
  • 8,877
  • 9
  • 71
  • 102