# gulp-ng-json2translate

> Inspired by grunt-json-angular-translate. Wrap json file as angular translate module

Latest version **0.1.3** (published 2015-01-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-ng-json2translate
pnpm add gulp-ng-json2translate
yarn add gulp-ng-json2translate
bun add gulp-ng-json2translate
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2015-01-03 |
| First published | 2014-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Felix Mosheev |
| Maintainers | felixmosh |
| Keywords | gulpplugin, angular, angular-translate, mock, json, value |

## Links

- npm: https://www.npmjs.com/package/gulp-ng-json2translate
- Repository: https://github.com/felixmosh/gulp-ng-json2translate
- Issues: https://github.com/felixmosh/gulp-ng-json2translate/issues
- npm.io page: https://npm.io/package/gulp-ng-json2translate

## Dependencies (3)

- [through2](https://npm.io/package/through2.md) ~0.6.2
- [gulp-util](https://npm.io/package/gulp-util.md) ~3.0.1
- [to-single-quotes](https://npm.io/package/to-single-quotes.md) ^1.0.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.3 (latest) — 2015-01-03
- 0.1.2 — 2014-12-28

## README

gulp-ng-json2translate
=========
[![Built with Gulp](https://img.shields.io/badge/Built%20with-Gulp-red.svg)](http://gulpjs.com/)

Plugin that wraps `json` as an angular translate module.

Inspired by https://github.com/shahata/grunt-json-angular-translate.

What is the result?
--
See <a href="https://github.com/felixmosh/gulp-ng-json2translate/tree/master/test/expect">here</a>

Install
--
```sh
npm install gulp-ng-json2translate
```

Usage
--

```javascript
var gulp=require('gulp');

var json2translate=require('gulp-ng-json2translate');
var concat=require('gulp-concat');

gulp.task('locale',function(){
    return gulp.src('./locale/*.json')
                .pipe(json2translate({
                    moduleName:'translations'
                }))
                .pipe(gulp.dest('./build/'));
});
```

options.moduleName
--
Type: `Sting`
Default: `translations`

The name of the generated AngularJS module.

options.extractLanguage
--
Type: `Function`

Custom function to retrieve language out of file name.

The default function can retrieve the language from files like that:
1. message_en.json
2. message-en.json
3. message.en.json

options.hasPreferredLanguage
--
Type: `Boolean`
Default: `true`

The flag that indicates if there will be preferred language statement at the output file.

Tests
--
```sh
npm test
```

License
----
Licensed under the MIT license.

---
_Source: https://npm.io/package/gulp-ng-json2translate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
