vue-chrome-i18n
v1.0.2
Published
Vue plugin for chrome extension internationalization
Downloads
12
Maintainers
Readme
Vue chrome i18n plugin
Install
npm install --save vue-chrome-i18n
# OR
yarn add vue-chrome-i18n
Build
git clone https://github.com/Xvezda/vue-chrome-i18n.git
cd vue-chrome-i18n
yarn install
yarn run build # dist/vue-chrome-i18n.js
Usage
HTML
<script src=".../vue.js"></script>
<script src=".../vue-chrome-i18n.js"></script>
<script>
Vue.use(VueChromeI18n); // Install plugin
</script>
then
<vue-chrome-i18n>__MSG_messagename__</vue-chrome-i18n>
or
<a href="..." target="_blank" v-chrome-i18n>__MSG_messagename__</a>
or
<div>{{ 'messagename' | chrome-i18n }}</div>
Options
| Attribute | Description | Type | Default |
| --------- | -------------------------------- | ------- | ------- |
| show | Set visibility | Boolean | true |
| nl2br | Replace linefeeds to <br>
tags | Boolean | false |
Example
https://xvezda.github.io/vue-chrome-i18n/demo/
Reference
- https://developer.chrome.com/extensions/i18n