@kazupon/vue-i18n-loader
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -0,1 +1,11 @@ | ||
<a name="0.1.1"></a> | ||
## [0.1.1](https://github.com/kazupon/vue-i18n-loader/compare/v0.1.0...v0.1.1) (2017-04-08) | ||
### :bug: Bug Fixes | ||
* fixed using single quotes ([#1](https://github.com/kazupon/vue-i18n-loader/issues/1)) by [@Neopren](https://github.com/Neopren) ([1911f64](https://github.com/kazupon/vue-i18n-loader/commit/1911f64)), closes [#1](https://github.com/kazupon/vue-i18n-loader/issues/1) | ||
<a name="0.1.0"></a> | ||
@@ -2,0 +12,0 @@ # 0.1.0 (2017-03-29) |
@@ -12,3 +12,3 @@ 'use strict'; | ||
value = JSON.stringify(value).replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029'); | ||
var code = 'module.exports = function (Component) { Component.options.__i18n = \'' + value + '\' }'; | ||
var code = 'module.exports = function (Component) { Component.options.__i18n = \'' + value.replace(/\u0027/g, '\\u0027') + '\' }'; | ||
this.callback(null, code); | ||
@@ -15,0 +15,0 @@ } catch (err) { |
{ | ||
"name": "@kazupon/vue-i18n-loader", | ||
"description": "vue-i18n loader for custom blocks", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "kazuya kawaguchi", |
# :globe_with_meridians: vue-i18n-loader | ||
[![CircleCI](https://circleci.com/gh/kazupon/vue-i18n-loader.svg?style=svg)](https://circleci.com/gh/kazupon/vue-i18n-loader) | ||
[![codecov](https://codecov.io/gh/kazupon/vue-i18n-loader/branch/master/graph/badge.svg)](https://codecov.io/gh/kazupon/vue-i18n-loader) | ||
[![npm](https://img.shields.io/npm/v/vue-i18n-loader.svg)](https://www.npmjs.com/package/vue-i18n-loader) | ||
[![codecov](https://codecov.io/gh/kazupon/vue-i18n-loader/branch/dev/graph/badge.svg)](https://codecov.io/gh/kazupon/vue-i18n-loader) | ||
[![npm](https://img.shields.io/npm/v/@kazupon/vue-i18n-loader.svg)](https://www.npmjs.com/package/@kazupon/vue-i18n-loader) | ||
@@ -11,7 +11,9 @@ vue-i18n loader for custom blocks | ||
$ npm i --save-dev vue-i18n-loader | ||
$ npm i --save-dev @kazupon/vue-i18n-loader | ||
## :rocket: Usage | ||
the below `App.vue` have `i18n` custom block: | ||
the below example that`App.vue` have `i18n` custom block: | ||
### Custom Blocks (Single File Components) | ||
```html | ||
@@ -41,2 +43,4 @@ <i18n> | ||
### JavaScript | ||
```javascript | ||
@@ -66,2 +70,4 @@ import Vue from 'vue' | ||
### Webpack Config | ||
configure webpack config for `vue-loader` (v11.3 later): | ||
@@ -77,3 +83,3 @@ | ||
loaders: { | ||
i18n: 'vue-i18n-loader' | ||
i18n: '@kazupon/vue-i18n-loader' | ||
} | ||
@@ -80,0 +86,0 @@ } |
@@ -10,3 +10,3 @@ export default function (content) { | ||
.replace(/\u2029/g, '\\u2029') | ||
const code = `module.exports = function (Component) { Component.options.__i18n = '${value}' }` | ||
const code = `module.exports = function (Component) { Component.options.__i18n = '${value.replace(/\u0027/g, '\\u0027')}' }` | ||
this.callback(null, code) | ||
@@ -13,0 +13,0 @@ } catch (err) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6810
97