This commit is contained in:
syuilo
2018-04-15 06:16:50 +09:00
parent d3b3a7fc4e
commit a53746e9d0
4 changed files with 12 additions and 9 deletions

View File

@ -11,7 +11,8 @@ module.exports = function(src) {
const g = search[search.length - 1] == 'g';
const file = this.resourcePath.replace(/\\/g, '/');
const replace = options.i18n ? global[options.replace].bind(null, {
src: file
src: file,
lang: options.lang
}) : global[options.replace];
if (typeof search != 'string' || search.length == 0) console.error('invalid search');
if (typeof replace != 'function') console.error('invalid replacer:', replace, this.request);