Skip to content

Commit

Permalink
Merge pull request #13 from teodors/master
Browse files Browse the repository at this point in the history
cross-platform path resolution
  • Loading branch information
bitjson committed Nov 30, 2015
2 parents e2c74ad + 5657525 commit ec3407d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var l10n = require('gulp-l10n');
var opts = {
elements: ['title', 'p', 'h1'],
attributes: ['alt', 'title'],
directives: 'translate=yes'
directives: 'translate=yes',
attributeSetter: 'translate-attrs'
};

Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var through = require('through2');
var gutil = require('gulp-util');
var s18n = require('s18n');
var path = require('path');

var PLUGIN_NAME = 'gulp-l10n';

Expand Down Expand Up @@ -110,7 +111,7 @@ module.exports.setLocales = function(options) {
return;
}
// file is buffer
var localeId = file.path.split('/').pop().split('.').shift();
var localeId = path.basename(file.path, '.json');
var locale = JSON.parse(String(file.contents));
localeCaches[options.cacheId].locales[localeId] = locale;
cb();
Expand Down

0 comments on commit ec3407d

Please sign in to comment.