Vue Translate
A translator directive for Vue.
The Basics
var Vue = ;var translate = ;Vue; // the messages datatranslatemessages = "hello": "你好";
Use as directive
The v-trans
directive will translate title
, arial-label
, alt
and text content
automaticly.
hello <!-- will be translated to -->你好
Translate more attributes
If the message you want to translate is not on the default attributes, e.g. data-message
,
you can pass it to v-trans
.
hello <!-- will be translated to -->你好