Questions tagged [vue-i18n]

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

Internationalization plugin for Vue.js.

Github Documentation

567 questions
9
votes
1 answer

How to bind attributes with v-bind only once?

I am using vue-i18n for localization. When I want to translate input placeholders, as in: I have to use the $t() function which is executed on every re-render (library…
Amade
  • 3,665
  • 2
  • 26
  • 54
9
votes
1 answer

Multiple translations files per language with vue-i18n and nuxtjs

I use nuxtjs and i18n to build a static website with multiple languages. At the moment I have one json file per language. For better structure i want to split the file in multiple files per language. How can i do that? Is there a way where i can…
Gregor Voinov
  • 2,203
  • 7
  • 34
  • 52
8
votes
5 answers

vue-i18n, alternative for this.$i18n using the composition api?

trying to implement vue-i18n in a component with composition api. I want to be able to set some translation messages inside of the onMounted hook. In the options api, I would use this.$i18n.setLocaleMessage(locale, messages). However, this is…
RuneRasset
  • 101
  • 1
  • 1
  • 5
8
votes
3 answers

how to import a json file using vite dynamicly

I am using vue-i18n in a Nuxtjs project, and I want to import my locale files with vite dynamicly. when I am using webpack, those code run well plugins/i18n.js import Vue from 'vue'; import VueI18n from 'vue-i18n'; import config from…
DengSihan
  • 2,119
  • 1
  • 13
  • 40
8
votes
2 answers

Is there a way to watch a change of the i18n's current locale?

How can I call a function when the language/locale changes while using i18n? Should I use Vuex or does vue-i18n has a method that allows me to do that?
Serio
  • 465
  • 4
  • 15
8
votes
2 answers

Internationalization for vue 3 vite with i18n

I'm currently trying to internationalize my vue 3 vite project with "@intlify/vite-plugin-vue-i18n". The problem I am facing here, is that i currently have to import and setup the t variable for every component to use it. example…
stackmeister
  • 199
  • 1
  • 2
  • 10
8
votes
1 answer

Internationalization in Vue.js using vue-i18n getting JSON Object from API server

Now I'm building an app in Vue.js supports multiple Languages. And I implemented internationalization using https://kazupon.github.io/vue-i18n. I want to change getting message part in i18n from static JSON file in a project to API call…
YOUNG MIN CHO
  • 253
  • 1
  • 3
  • 13
8
votes
2 answers

Internationalization of Vuetify data table header

I'm trying to internationalize my data table header using Vuetify + I18n. When I translate my normal code, it works correctly, but now I need to translate the header of my data table built with Vuetify. I've already tried to add the code…
rmmariano
  • 896
  • 1
  • 18
  • 32
8
votes
1 answer

vue-i18n: component interpolation with html tags

i'm using component interpolation as described here but also have some html tags in my translation string for formatting purposes. how should i deal with this?
Jörn
  • 845
  • 5
  • 16
7
votes
1 answer

How to configure `I18n Ally` VsCode plugin to read my locals from one single file?

I'm using vue-i18n package to translate my Vue project and want to use "I18n Ally" vs code extention to manage translations. The default folder structure for this extension is this: locales # i18n, langs, locale are also acceptable ├──…
rostamiani
  • 2,859
  • 7
  • 38
  • 74
7
votes
1 answer

Vue-router update routes programmatically

Is there any way to update Vue-router routes programmatically without reloading the page? I'm loading different route paths based on the language that is selected, e.g.: { path: '/' + i18n.t('url_welcome'), name: 'welcome, component: Welcome…
butaminas
  • 672
  • 7
  • 23
7
votes
1 answer

Using Vuetify with i18n using CDNs only

I'm working on a Vue project on a static environment with no Node or Vue-cli, We're importing Vue, Vuetify and vue-i18n using CDNs We need to have the Vuetify components translated using the Vue-i18n like shown here Here is a codepen of an attempt…
ZimGil
  • 877
  • 4
  • 12
7
votes
4 answers

Access vue-i18n messages as object

I want to create a dynamical slider which depends on the page. security_signin: { slide1: 'Kitten1', slide2: 'Kitten2', }, signup: { slide1: 'Kitten1', slide2: 'Kitten2', slide3: 'Kitten3' …
Baldráni
  • 5,332
  • 7
  • 51
  • 79
7
votes
3 answers

Setting the language attribute when using i18n and Nuxt?

With Nuxt, you can set the language HTML attribute inside the nuxt.config.js file like so: module.exports = { head: { htmlAttrs: { lang: 'en-GB', }, ... etc etc However, what should you do if you have a multi-language app? Is there any…
JMK
  • 27,273
  • 52
  • 163
  • 280
7
votes
1 answer

How to use vue-i18n inside my vue-route?

My main app.js import Vue from 'vue' import language from './language' import VueI18n from 'vue-i18n' Vue.use(VueI18n) const i18n = new VueI18n({ locale: 'en', messages:…
user2650480
  • 429
  • 2
  • 5
  • 17
1
2
3
37 38