1.2.1 • Published 4 years ago

gulp-combine-language v1.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Gulp Combine Language

Gulp plugin to combine JSON language files

It expects translations to be named as en.json, en-EN.json or similar. Your project tree might look for example like

src/
    app/
        module1/
            languages/
                en.json
                es.json
                eu.json

Result:

{
    "FIRST": {
        "HELLO": {
            "en": "Hello",
            "es": "Hola",
            "eu": "Kaixo"
        }
    },
    "SECOND": {
        "THIRD": {
            "WORLD": {
                "en": "World",
                "es": "Mundo",
                "eu": "Mundu"
            }
        },
        "TEST": {
            "en": "Test",
            "es": "",
            "eu": ""
        }
    }
}

Usage

Install gulp-combine-language as a development dependency:

npm install -D gulp-combine-language

Add it to your gulpfile.js:

const combine_language = require("gulp-combine-language");

gulp.src("src/app/**/languages/*.json")
	.pipe(combine_language("translations.json"))
	.pipe(gulp.dest(""));
1.2.1

4 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago