Gathering detailed insights and metrics for gulp-translator-d
Gathering detailed insights and metrics for gulp-translator-d
Gathering detailed insights and metrics for gulp-translator-d
Gathering detailed insights and metrics for gulp-translator-d
npm install gulp-translator-d
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
15 Commits
1 Watchers
1 Branches
1 Contributors
Updated on May 30, 2015
Latest Version
0.1.4
Package Id
gulp-translator-d@0.1.4
Size
6.56 kB
NPM Version
2.14.2
Node Version
0.10.40
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Almost like string replace but using locales
First, install gulp-translator-d
as a development dependency:
1npm install --save-dev gulp-translator-d
Then, add it to your gulpfile.js
:
1var translate = require('gulp-translator'); 2 3gulp.task('translate', function() { 4 var translations = ['pl', 'en']; 5 6 translations.forEach(function(translation){ 7 gulp.src('app/views/**/*.html') 8 .pipe(translate('./locales/'+ translation +'.yml')) 9 .pipe(gulp.dest('dist/views/' + translation)); 10 }); 11});
or better, handle errors:
1gulp.task('translate', function() { 2 var translations = ['pl', 'en']; 3 4 translations.forEach(function(translation){ 5 gulp.src('app/views/**/*.html') 6 .pipe( 7 gulpTranslateTemplate('./locales/'+ translation +'.yml') 8 .on('error', function(){ 9 console.dir(arguments); 10 }) 11 ) 12 .pipe(gulp.dest('dist/views/' + translation)); 13 }); 14});
I'm using {{{}}}
to avoid conflict with angular-like syntax
Following examples assume that "title" in locales equals "new TITLE"
Example:
{{{ title }}} will be change to "new TITLE"
If you'd like to use filters(look at the bottom to check available filters) just pass them after like that:
{{{ title | lowercase }}} will be change to "new title"
{{{ title | uppercase }}} will be change to "NEW TITLE"
If you're still not sure, please look at tests.
gulp-translator is called with a string
Type: String
The string is a path to a nameOfTheFile.yml with your locales. Please look at test/locales for examples.
refactor tests
work on matchers (sigh...)
add filters:
add option to dynamically add filters
filter chain
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/15 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More