【发布时间】:2020-11-29 18:44:09
【问题描述】:
我已经在我的 NuxtJS 网站中成功安装了 vue-fb-customer-chat 插件,并且聊天工作正常。
这是一个多语言网站,我需要能够以正确的语言加载聊天(来自nuxt-i18n 模块的当前语言环境)。如果在从网站内切换语言后聊天不会更改其语言,那没关系,但我希望在页面加载时至少有正确的语言。
这是plugins/vue-fb-customer-chat.js文件的内容:
import Vue from 'vue'
import VueFbCustomerChat from 'vue-fb-customer-chat'
Vue.use(VueFbCustomerChat, {
page_id: null, // change 'null' to your Facebook Page ID,
theme_color: '#845e5c', // theme color in HEX
locale: 'fr_FR', // default 'en_US'
})
以下均无效:
context.app.i18n.locale
this.$i18n.locale
$i18n.locale
解决这个问题的方法是什么?
提前感谢您的帮助。
【问题讨论】:
标签: javascript internationalization nuxtjs nuxt-i18n