Package Exports
- @kazupon/vue-i18n-loader
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@kazupon/vue-i18n-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π vue-i18n-loader
vue-i18n loader for custom blocks
πΏ Installation
$ npm i --save-dev @kazupon/vue-i18n-loader
π Usage
the below example thatApp.vue
have i18n
custom block:
Custom Blocks (Single File Components)
<i18n>
{
"en": {
"hello": "hello world!"
},
"ja": {
"hello": "γγγ«γ‘γ―γδΈη!"
}
}
</i18n>
<tempalte>
<p>{{ $t('hello') }}</p>
</template>
<script>
export default {
name: 'app',
// ...
}
</script>
JavaScript
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import App from './App.vue'
Vue.use(Vue-i18n)
const i18n = new VueI18n({
locale: 'en',
messages: {
en: {
// ...
},
ja: {
// ...
}
}
})
new Vue({
i18n,
render: h => h(App)
}).$mount('#app')
Webpack Config
configure webpack config for vue-loader
(v11.3 later):
module.exports = {
module: {
rules: [{
test: /\.vue$/,
loader: 'vue',
options: {
loaders: {
i18n: '@kazupon/vue-i18n-loader'
}
}
}]
}
}
π Changelog
Details changes for each release are documented in the CHANGELOG.md.
πͺ Contribution
Please make sure to read the Contributing Guide before making a pull request.