question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot translate the value of keypath 'language_option'. Use the value of keypath as default.

See original GitHub issue

I followed the documentation and read every issue related to this error, but still couldn’t fix it. For some reason it can’t translate it, but it doesn’t tell me why. It only outputs this line into the console: Cannot translate the value of keypath 'language_option'. Use the value of keypath as default.

vue & vue-i18n version

2.6.10, 8.11.2

Full code:

https://github.com/MRVDH/mapping-north-korea/tree/2-Add-multi-language-support/client

Reduced code:

main.js:

import Vue from 'vue';
import Vuetify from 'vuetify';
import VueI18n from 'vue-i18n';
import App from './App';
import router from './router';
import 'vuetify/dist/vuetify.min.css';

Vue.config.productionTip = false;

Vue.use(Vuetify);
Vue.use(VueI18n);

/* eslint-disable no-new */
new Vue({
    i18n: {
        fallbackLocale: 'en'
    },
    el: '#app',
    router,
    components: { App },
    template: '<App/>'
});

Component file:

<template>
    <v-toolbar app>
        <v-btn @click.stop="toggleLanguage()">
            {{ $t('language_option') }}
        </v-btn>
    </v-toolbar>
</template>

<i18n>
{
  "en": {
    "language_option": "한국어"
  },
  "ko": {
    "language_option": "English"
  }
}
</i18n>

<script>
export default {
    name: 'Example',
    data () {
        return {
            locale: 'en'
        };
    },
    methods: {
        toggleLanguage: function () {
            console.log('toggle!');
        }
    }
};
</script>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

3reactions
alexeigscommented, Oct 4, 2019

I still face the same issue despite the steps described. Warnings are not silenced and I keep getting the following, when locale en is active. No issues when de is active.

[vue-i18n] Value of key 'Hi, nice to meet you' is not a string! 2 vue-i18n.esm.js:32
[vue-i18n] Cannot translate the value of keypath 'Hi, nice to meet you'. Use the value of keypath as default.

Setup:

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

en.ts

export default {
  Common: {
    about_us: 'About us',
  }
}

de.ts

export default {
  Common: {
    about_us: 'Über uns',
  },
  'Hi, nice to meet you': 'Hallo, schön dich kennenzulernen'
}
3reactions
Silbadcommented, Jun 19, 2019

Oh sorry before return of data :

    data: function() {
        this.$i18n.locale = 'en';
        return {
            locale: 'en'
        };
    },
Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue: vue-i18n: Cannot translate the value of keypath, Use the ...
Use the value of keypath as default. I checked if the plugin is working by console.log(this.$i18n.locale). And the result was "en".
Read more >
Cannot translate the value of keypath 'message.welcome ...
I get this error: vue-i18n.common.js:16 [vue-i18n] Cannot translate the value of keypath 'message.welcome'. Use the value of keypath as default.
Read more >
I18n - Cannot translate the value of keypath - Vue Forum
Hello everyone, I am using i18n for translations on my website. It was working fine till 6th October 2018, but I'm getting the...
Read more >
Cannot translate the value of keypath - Laracasts
Hi! Have this error on every place i set text app.js:32228 [vue-i18n] Cannot translate the value of keypath What is the problem ?...
Read more >
[vue-i18n] Cannot translate the value of keypath 'message ...
Use the value of keypath as default. #1150. jackDani16 posted onGitHub. This is my en.json: { "message ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found