Show Vue meta i18n variable names instead of values
<p>I have a vue2 project and use vue-meta and vue-i18n to localize the project.
In my browser bookmarks, the title of the web page is not shown, instead the variable is shown. The same issue occurs in Google Analytics, it seems to show the variable instead of the value in the variable. </p>
<p>This is the code snippet of my Home component: </p>
<pre class="brush:php;toolbar:false;">name: 'Home',
metaInfo () {
return {
title: this.$t("home.meta.title"),
meta: [{
name: "description",
content: this.$t("home.meta.descriptioncontent")
}, {
name: "keywords",
content: this.$t("home.meta.keywordscontent")
},
{ property: 'og:title', content: this.$t("home.meta.title")},
{ property: 'og:site_name', content: 'www.examplesite.se'},
{ property: 'og:description', content: this.$t("home.meta.descriptioncontent")},
{ property: 'og:type', content: 'Home'},
{ property: 'og:url', content: 'https://examplesite.se/'},
{ property: 'og:image', content: 'https://www.examplesite.se' '/img/' 'example_logo_social.png'}
]
}
},
data() {
return {
fimagefolder: '../../Images/',
bimagefolder: '../../fImages/',
};
},</pre>
<p>So this.$t("home.meta.title") variable stores the Swedish and English translations. Inside the site, it shows the correct title in both languages, but Google Analytics only shows "home.meta.title". </p>
<p>From what I understand, the crawler can't see my variable values because it doesn't have any scripts loaded. Any ideas? </p>