vuejs插件
Vue-Polyglot (Vue-Polyglot)
basic translation plugin for VueJS 2+.
VueJS 2+的基本翻译插件。
安装 (Installation)
npm install --save vue-polyglot
TLDR (TLDR)
-
can load translation asynchronously with HTTP requests (use
axios
module)可以通过HTTP请求异步加载翻译(使用
axios
模块) -
guess browser language and use it automatically
猜测浏览器语言并自动使用
-
default message directly in your component
默认消息直接在您的组件中
{ { $t('error_684', 'User already exists') }}
{ { $t('error_684', 'User already exists') }}
-
load data in translation
加载翻译数据
this.$t('helloUser', 'hello {user}', {user: 'toto'})
> hello totothis.$t('helloUs