Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I change the language after configuration? #2

Closed
thelinuxlich opened this issue Dec 18, 2014 · 67 comments
Closed

How do I change the language after configuration? #2

thelinuxlich opened this issue Dec 18, 2014 · 67 comments
Milestone

Comments

@thelinuxlich
Copy link

No description provided.

@kazupon
Copy link
Owner

kazupon commented Dec 18, 2014

sorry, this plugin cannot change the language after the configuration.

@kazupon
Copy link
Owner

kazupon commented Jan 10, 2015

@thelinuxlich
Hi
I released vue-i18n new version.
You can change language the below code.

<p>{{ $t('message.hello', 'en') }}</p>

Please try it !!

@thelinuxlich
Copy link
Author

I tested it and it is useful but I think that it would be better to somehow set lang parameter as observable and change globally based on it

@kazupon
Copy link
Owner

kazupon commented Jul 3, 2015

I add Vue.config.lang configuration.

@kazupon kazupon closed this as completed Jul 3, 2015
@thelinuxlich
Copy link
Author

This doesn't solve the issue unless Vue.config.lang is reactive

@kazupon
Copy link
Owner

kazupon commented Jul 3, 2015

Sorry,
I didn't understand your request.

I think that it would be better to somehow set lang parameter as observable and change globally based on it

You need reactive lang params, don't you ?

@thelinuxlich
Copy link
Author

yeah, I believe it's a common case for the user switching the language during interaction

@kazupon
Copy link
Owner

kazupon commented Jul 3, 2015

OK.
I'll try out. :)

@kazupon kazupon reopened this Jul 3, 2015
@nkovacs
Copy link

nkovacs commented Aug 4, 2015

@ChrisRM
Copy link

ChrisRM commented Oct 13, 2015

Any news on this one?

@SystemZ
Copy link

SystemZ commented Oct 18, 2015

I'm interested in easy switching languages by user too.

@martinlindhe
Copy link
Contributor

+1
i tried making a language switcher widget, but it don't seem to update the translations after Vue.config.lang has been changed

@seemsindie
Copy link

+1

1 similar comment
@tasarsu
Copy link

tasarsu commented Jan 2, 2016

+1

@flaird
Copy link

flaird commented Jan 5, 2016

+1
@martinlindhe Did you get it to work?

@flaird
Copy link

flaird commented Jan 27, 2016

@kazupon This package https://github.com/Haixing-Hu/vue-i18n has support for this through jQuery AJAX calls(from what I can tell). Perhaps you can use some of it's logic to solve this issue. Just a thought!

@martinlindhe
Copy link
Contributor

@sagaio: nope, i'm currently working around it by doing a page reload when language was changed.

location.reload();

works, but ain't pretty!

@rtfleg
Copy link

rtfleg commented Jan 29, 2016

+1

1 similar comment
@stephanedemotte
Copy link

+1

@ghost
Copy link

ghost commented Feb 27, 2016

+1

@martinlindhe
Copy link
Contributor

Was thinking of this issue again today and came up with this solution.
It involves using a new tag and I'm not sure i gonna do this on my current vue project, but maybe for the next one.

First, we have someplace in our ui to change language.

to change language you do something like this

select(code) {
    Vue.config.lang = code;
    this.$broadcast('language');
}

to put translations in our templates, we now do <t t="user.new"></t>

and finally a T.vue component:

<template>
    <span>
        {{ translated }}
    </span>
</template>

<script>
export default {
    props: {
        t: '',
    },
    data() {
        return {
            translated: '',
        };
    },
    ready() {
        this.translated = this.$t(this.t);
        this.$on('language', function() {
            this.translated = this.$t(this.t);
        });
    },
};
</script>

Now your language changes are reactive.

@MattyRad
Copy link

MattyRad commented Mar 1, 2016

+1

@seemsindie
Copy link

@kazupon I would like to add this feature myself, but i can't afford it right now...but i would like to know do you plan to support this or should i switch to what @sagaio said?

@francoisromain
Copy link

@pespantelis thanks a lot : )

I solved it a different way, as I use vue-router:

in the main js file:

router.beforeEach((to, from, next) => {
    Vue.config.lang = to.params.lang;
    next();
});

and the lang-select component:

<template>
    <div class="lang-select">
        <button @click="change('en')">en</button>
        <button @click="change('de')">de</button>
        <button @click="change('fr')">fr</button>
    </div>
</template>

<script>
    export default {
        methods: {
            change (lang) {
                const route = Object.assign({}, this.$route);
                route.params.lang = lang;
                this.$router.push(route);
            }
        }
    };
</script>

What do you think about this solution?

@TheBroox
Copy link

TheBroox commented Mar 24, 2017

@pespantelis' altering of the prototype is by far the most elegant solution. Really feels like it should be baked in.

@ssc-hrep3
Copy link

ssc-hrep3 commented Apr 7, 2017

With Vue i18n 6.0, you need to adapt the locale property of VueI18n to change the language. I solved it like this:

Vue.use(VueI18n);

const i18n = new VueI18n({
	locale: 'en',
	fallbackLocale: 'en',
	messages: { [...] }
});

Vue.prototype.$locale = {
	change (language) {
		i18n.locale = language;
	},
	current () {
		return i18n.locale;
	}
};

new Vue({
	el: '#app',
	i18n,
	[...]
});

@kazupon
Copy link
Owner

kazupon commented Apr 7, 2017

You can set the locale via $i18n property of Vue instance. :)
https://kazupon.github.io/vue-i18n/en/api.html#injected-properties

@nickkuijpers
Copy link

Ha, @kazupon, your response fixed it. Been trying for 3 hours but we only had do to this haha;

The value en can be dynamic.

this.$i18n.locale = 'en' 

If it does not work, make sure you can console log the right instance.

@pedrocatre
Copy link

thanks for the information @nickkuijpers, worked great.

@roelvan
Copy link

roelvan commented Jun 13, 2017

@nickkuijpers and @TheBroox the documentation says this property is readonly. That is a typo I guess?

@nickkuijpers
Copy link

@roelvan i think so because in my end it works. Have u tried it?

@TheBroox
Copy link

TheBroox commented Jun 13, 2017

@roelvan it worked for me but after upgrading to i18n 6.0+ I have switched to @ssc-hrep3's solution. It still extends the prototype but the altered values are slightly different.

My i18n file:

import Vue from 'vue'
import VueI18n from 'vue-i18n'

Vue.use(VueI18n)

import english from './english.js'
import spanish from './spanish.js'
import french from './french.js'

var messages = {
	en : english,
	sp : spanish,
	fr : french
}

const i18n = new VueI18n({
	locale: 'en',
	fallbackLocale: 'en',
	messages
})

Vue.prototype.$locale = {
	change (lang) {
		i18n.locale = lang
	},
	current () {
		return i18n.locale
	}
}

export default i18n

And then how I incorporate it into a template:

<template>
	<div class="container-fluid">
    <router-view></router-view>
		<div class="row">
			<div class="languages col-xs-12">
				<ui-button v-if="this.$locale.current() !== 'en'" type="secondary" @click="changeLang('en')">
					English
				</ui-button>
				<ui-button v-if="this.$locale.current() !== 'sp'" type="secondary" @click="changeLang('sp')">
					Spanish
				</ui-button>
				<ui-button v-if="this.$locale.current() !== 'fr'" type="secondary" @click="changeLang('fr')">
					French
				</ui-button>
			</div>
		</div>
	</div>
</template>


<script>
	export default {
		name: 'Localization',
		methods : {
			changeLang: function(newLang){
				this.$locale.change(newLang)
			}
		}
	}
</script>

@roelvan
Copy link

roelvan commented Jun 14, 2017

@nickkuijpers yep it seems to work for me. Thanks for sharing @ssc-hrep3's elegant solution @TheBroox. I used your snippet :)

@EmadAdly
Copy link

I think the Elegant Solution is
Within the same component, you can path the language value to a method that switches in the global range through this. $ I18n.locale = value

For example

</template>
    <button  @click="setLanguage('en')">en</button>
    <button  @click="setLanguage('de')">de</button>
    <button  @click="setLanguage('fr')">fr</button>
</template>


<script>
export default {

....

  methods: {
    setLanguage (val) {
      this.$i18n.locale = val
    }
  }
}
</script>

it will update language without refresh page or reload or redirect.

@spacemudd
Copy link

spacemudd commented Jul 20, 2017

const app = new Vue({
    el: '#app',
  	mounted() {
  	  Vue.config.lang = document.querySelector("html").lang
  	}
});

In my case, Laravel takes care of filling up the 'lang' attribute in html so I see no reason to make this any more complicated.

@TheBroox
Copy link

TheBroox commented Jul 20, 2017

If you are looking for a completely js solution that can be set on page load via query string param as well as offering buttons to the user.

<template>
        <button v-for="lang in notCurrentLangs" :key="lang.file" @click="changeLang(lang.key)">
          {{lang.name}}
        </ui-button>
</template>


<script>
	export default {
		name: 'Localization',
    data(){
      return {
        langs: [
          {key: 'en', name: 'English'},
          {key: 'sp', name: 'Spanish'},
          {key: 'fr', name: 'French'},
          {key: 'ho', name: 'Hodor', hidden: true}
        ]
      }
    },
    computed: {
      notCurrentLangs(){
        var currentLang = this.$locale.current()
        return this.langs.filter(function(lang){
          return lang.key !== currentLang && !lang.hidden
        })
      }
    },
		methods : {
			changeLang: function(newLang){
				this.$locale.change(newLang)
			},
      hasLang: function(checkKey) {
        var hasLang = false
        this.langs.forEach(function(lang){
          if(lang.key === checkKey){
            hasLang = true
          }
        })
        return hasLang
      }
		},
    created(){
      if(this.$route.query.lang && this.hasLang(this.$route.query.lang)){
        this.changeLang(this.$route.query.lang)
      }
    }
	}
</script>

@janein
Copy link

janein commented Aug 7, 2017

@EmadAdly I tried your code as it's very similar to the one in the docs.
I can change the locale with this.$root.$i18n.locale = val, but all components update only after the next page change. until then nothing happens.
Any idea how I can force an "update"?

PS: Everything inside this components changes, but other components stay the same. Until I change the page.

@janein
Copy link

janein commented Aug 7, 2017

Well, seems like I used the translations in a wring way.
I set some data props, but those do not get updated. So I guess the best way to use the translations is to always do it in the template.

@EmadAdly
Copy link

EmadAdly commented Aug 11, 2017

@janein
sorry for that , val must be stored in local storage So add this line inside the setLanguage method

    setLanguage (val) {
      this.$i18n.locale = val
      window.localStorage.setItem('Language', val)
    }

and in main.js read locale from local storage like the below

const i18n = new VueI18n({
  locale: window.localStorage.getItem('userLanguage'), // get locale
  messages // set locale messages
})

@longprao
Copy link

longprao commented Aug 22, 2017

If you want to do it inside a component:

selectLanguage(lang) {
   this.$root.$i18n.locale = lang;
   window.localStorage.language = lang;
},

If you want to use in vuex, so you can easily access/watch in other components:

// i18n.js
import Vue from 'vue';
import VueI18n from 'vue-i18n';

Vue.use(VueI18n);

export default new VueI18n({
  locale: window.localStorage.language || navigator.language || 'en',
});

// store.js
import i18n from '../i18n';

mutations: {
  [SET_LANGUAGE](state, payload) {
    state.language = payload.data;
    i18n.locale = payload.data;
    window.localStorage.language = payload.data;
  },
},
actions: {
  setLanguage: ({ commit }, data) => {
    commit(SET_LANGUAGE, { data });
  },
},

@janein
Copy link

janein commented Aug 23, 2017

@EmadAdly @longprao Thanks, your approach looks nice.
I got another solution in the meantime. As I work with vuex I wanted to have a centralized solution to get/set the language.
I handle all my communication with the localStorage in a separate file, whose methods get called from my vuex-store's actions.
To get my language a again on restart I do something like this:

/* main.ts */
import store from './store';
const app = new Vue({
  // ...
  store
});
store.dispatch('settings/loadSettings');
/* store/settings/actions.ts */
export const loadSettings = (state) => {
    return SettingsApi.fetchSettings().then((res) => {
       state.commit('loadSettings', res);
    });
};
/* api/settings-api.ts */
namespace SettingsApi {
  export const fetchSettings = () => {
        return localforage.startsWith(STORAGE_PREFIX).then(async (settings): Promise<SettingsState>  => {
            settings = stripSettingsPrefix(settings);

            // merge with default settings
            const allSettings = (Object as any).assign({}, defaultSettings, settings);
            await saveAllSettings(allSettings);

            return allSettings;
        });
    };
   export const saveAllSettings = async (settings) => {
        for (const setting of Object.keys(settings)) {
            const value = settings[setting];
            await saveSetting(setting, value);
        }
        return settings;
    };

    export const saveSetting = (key, value) => {
        if (key === 'language') {
            (window as any).app.$root.$i18n.locale = value;
        }

        return localforage.setItem(STORAGE_PREFIX + key, value)
            .then((val) => val)
            .catch((err) => {
                console.warn(`
                    oooops ${key} with the value "${value}" could not be saved to the local storage! :(
                `, err);
            });
    };
}

This works pretty neat as it handles all settings and not just the language.
And it is fast too, so you don't get a delay where you can see the language switch fron the default language to the saved one.
Maybe this helps someone who tries so achieve something similar :)

@iMomen
Copy link

iMomen commented Sep 23, 2017

What if I want to reload the page to receive new content based on the user language and also I want to change the stylesheet file based on it?

@bungbung2
Copy link

@ealves-pt @longprao

Your ideas were helpful.

i solve the problem and i didn't use VueX

// lang.js
import Vue from 'vue'
import VueI18n from 'vue-i18n'

Vue.use(VueI18n)

let i18n = new VueI18n({
  messages: {}
})

let setLocale = function (locale) {

  if (locale === undefined) {
    i18n.locale = window.localStorage.language || navigator.language || 'en'
  }
  else {
    i18n.locale = locale
  }

  try {
    if (!i18n.messages[i18n.locale]) {
      let addMessage = require('../message-' + i18n.locale + '.json')
      i18n.mergeLocaleMessage(i18n.locale, addMessage)
    }

    window.localStorage.language = i18n.locale
  }
  catch (error) {
  }
}

export default {i18n, setLocale}
// main.js

import 'babel-polyfill'

import Vue from 'vue'
import Quasar from 'quasar'
import lang from 'util/lang'

Vue.use(Quasar) // Install Quasar Framework

Quasar.start(() => {
  Vue.mixin({
    data: () => {
      return {
        lang: lang
      }
    }
  })

  new Vue({
    el: '#q-app',
    store,
    router,
    i18n: lang.i18n,
    render: h => h(require('./App')),
    created: function () {
      this.lang.setLocale()
    }
  })
})

@AbdullaevTimur
Copy link

I use another solution for setting language (in main.js):
`function checkLang () {
var navigatorLang = navigator.language || navigator.userLanguage
var langList = ['ru', 'en']
var fallbackLang = 'en'
var settingLang = langList.includes(navigatorLang) ? navigatorLang : fallbackLang
var lang = window.localStorage.getItem('userLang')
return lang.length > 0 ? lang : settingLang
}

const i18n = new VueI18n({
locale: checkLang(),
fallbackLocale: 'en',
dateTimeFormats: 'long'
})`

@martinnaughton
Copy link

martinnaughton commented Jun 22, 2018

In my vue component file I have a method that can change. Just tested this and it was reactive to change it from en to fr and the UI updated straight away.

change: function () {
    this.$i18n.locale = 'fr';
}

@aligajani
Copy link

I am doing this

router.beforeEach((to, from, next) => {

  // possible entry points where language should be set
  let entryPoints = ["login", "token"];

  if (entryPoints.includes(to.name)) {
    console.log("Setting locale from supported entry points")
    
    let languageQuery = to.query.locale || "en";
    i18n.locale = languageQuery;

    // This will allow us to use it later
    window.localStorage.setItem('locale', languageQuery);
    Cookies.set('locale', languageQuery);

  } else {
    console.log("Setting locale from localStorage or Cookies");
    i18n.locale = window.localStorage.getItem('locale') ||  Cookies.get('locale');
  }

})

@mchikhaoui
Copy link

this.$i18n.locale = 'your locale'

kazupon pushed a commit that referenced this issue Mar 27, 2019
closes #531 

* docs: add vuepress zh docs config

* docs(zh/README.md): Translation README.md file

* docs(zh/README.md): Translation installation.md file

* docs: Translation introduction.md file

* docs: Translation started.md file

* docs: 更改称谓

* docs: Translation api/README.md file

* style: values type

* fix: pluralization -> 多元化

* fix: locale translation

* docs: Translation api/formatting file

* docs: Translation guide/pluralization.md file

* fixed: fix type

* docs: All translation completed

* Update vuepress/.vuepress/config.js

参照Vue的规范修正译文中的格式

Co-Authored-By: xuhongbo <[email protected]>

* fix: type

* fix: 区域设置 -> 语言环境

* style: Modify the format including punctuation and spaces

* fix: 修复vuepress config

* Update if not ..., check ... -> 如果没有则

Co-Authored-By: xuhongbo <[email protected]>

* Update 主语前置

Co-Authored-By: xuhongbo <[email protected]>

* Update 完善用语

Co-Authored-By: xuhongbo <[email protected]>

* Update 语义更明确

Co-Authored-By: xuhongbo <[email protected]>

* fix: Correct the format to remove extra spaces

* update: 提示 -> tip

* Update vuepress/zh/api/README.md

Co-Authored-By: xuhongbo <[email protected]>

* 更改主谓

Co-Authored-By: xuhongbo <[email protected]>

* 提高句子的可读性

Co-Authored-By: xuhongbo <[email protected]>

* 提高句子的可读性

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/api/README.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/api/README.md

Co-Authored-By: xuhongbo <[email protected]>

* fix: Fix some keyword errors and various issues

* update: Optimize text for readability

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/formatting.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/hot-reload.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/interpolation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/interpolation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/interpolation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/interpolation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/interpolation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/lazy-loading.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/lazy-loading.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/lazy-loading.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/locale.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/locale.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/locale.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/lazy-loading.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/lazy-loading.md

Co-Authored-By: xuhongbo <[email protected]>

* 区域 -> 语言环境, 消息 -> 信息

* Update vuepress/zh/guide/messages.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/messages.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/messages.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/messages.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/number.md

Co-Authored-By: xuhongbo <[email protected]>

* fix: Locale Messages -> 语言环境信息

* 同步源仓库到Fock仓库 (#1)

* ⭐ new(path): Keypath should parse if sub path contains spaces. (#533) by @exoego

* feat(path): Keypath should parse if sub path contains spaces.

* feat(path): Added test for whitespaces

* 📝 docs(vuepress): pluralization will not work unless you use $tc (#540) by @lebesnec

* ⭐ new(number): i18n-n functional component (#541) by @bponomarenko

* Revert "同步源仓库到Fock仓库 (#1)" (#2)

This reverts commit 8f8a88b.

* Update vuepress/zh/guide/pluralization.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/pluralization.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/pluralization.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/guide/sfc.md

Co-Authored-By: xuhongbo <[email protected]>

* style: code style

* Update vuepress/zh/installation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/installation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/installation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/installation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/installation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/installation.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/introduction.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/introduction.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/introduction.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/introduction.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/started.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/started.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/started.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/started.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/started.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/legacy/README.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/legacy/README.md

Co-Authored-By: xuhongbo <[email protected]>

* Update vuepress/zh/legacy/README.md

Co-Authored-By: xuhongbo <[email protected]>
kazupon added a commit that referenced this issue Apr 11, 2020
* - adds tests for fallbacks to be implemented (#2)

* adds tests for fallbacks to be implemented (#2)

* implementation for complex fallback variants (#2)

* fixed test errors (#2)

* fixed some documentation (#2)

* fixes fallback test (#2)

* refactor fallback tests (#2)

* allow fallbackLocale to be false explicit (#2)

* fixing test message (#2)

* fixing use of wrong variable and type

* Update src/index.js - according suggestion :+1

Co-Authored-By: kazuya kawaguchi <[email protected]>

Co-authored-by: kazuya kawaguchi <[email protected]>
@uniquejava
Copy link

How to do this in vue3 composition api and vue-i18n@9, there is no this.$i18n

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests