Skip to content

Commit

Permalink
⬆️ Update h5i18n@0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zswang committed May 18, 2017
1 parent c39e74a commit 780d873
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gulp.task('dist', function() {

Set default language.

- `lang`
- `locale`

Set current Language.

Expand Down
8 changes: 4 additions & 4 deletions lib/gulp-h5i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*
* A mobile page of internationalization development framework
* @author
* ()
* @version 0.0.3
* @date 2017-05-11
* zswang (http://weibo.com/zswang)
* @version 0.0.4
* @date 2017-05-18
*/
var h5i18n_compiler = require('h5i18n/lib/compiler');
var through = require('through2');
Expand Down Expand Up @@ -49,7 +49,7 @@ module.exports = function (options) {
}
var contents = h5i18n_compiler.Compiler.replace(file.contents, {
defaultLang: options.defaultLang,
lang: options.lang,
locale: options.locale,
map: map,
});
file.contents = new Buffer(contents);
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-h5i18n",
"version": "0.0.3",
"version": "0.0.4",
"description": "A mobile page of internationalization development framework",
"main": "lib/gulp-h5i18n.js",
"scripts": {
Expand All @@ -16,7 +16,10 @@
"keywords": [
"i18n"
],
"author": "zswang",
"author": {
"name": "zswang",
"url": "http://weibo.com/zswang"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/zswang/gulp-h5i18n/issues"
Expand All @@ -30,7 +33,7 @@
},
"dependencies": {
"gulp-util": "^3.0.8",
"h5i18n": "^0.3.5",
"h5i18n": "^0.5.0",
"through2": "^2.0.3"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/gulp-h5i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = function (options) {

var contents = h5i18n_compiler.Compiler.replace(file.contents, {
defaultLang: options.defaultLang,
lang: options.lang,
locale: options.locale,
map: map,
});
file.contents = new Buffer(contents);
Expand Down
8 changes: 4 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ describe('fixtures', function () {
var input = 'console.log(languages.get("中文<!--{en}English-->"))';
var output = 'console.log("English")';
expect_equals({
lang: 'en'
locale: 'en'
}, input, output, done);
});

it('case map', function (done) {
var input = 'console.log(languages.get("点击<!--{*}click-->"))';
var output = 'console.log("クリック")';
expect_equals({
lang: 'jp',
locale: 'jp',
map: {
click: '<!--{jp}クリック-->'
}
Expand All @@ -58,7 +58,7 @@ describe('fixtures', function () {
var input = 'console.log(languages.get("click<!--{*}-->"))';
var output = 'console.log("クリック")';
expect_equals({
lang: 'jp',
locale: 'jp',
map: {
click: '<!--{jp}クリック-->'
}
Expand All @@ -69,7 +69,7 @@ describe('fixtures', function () {
var input = 'console.log(languages.get("双击<!--{*}dblclick-->"))';
var output = 'console.log("Двойной щелчок")';
expect_equals({
lang: 'ru',
locale: 'ru',
mapfile: './test/map.json'
}, input, output, done);
});
Expand Down

0 comments on commit 780d873

Please sign in to comment.