This commit is contained in:
syuilo 2017-12-08 02:48:21 +09:00
parent 822ba594ec
commit f1a5ac537c

View File

@ -32,17 +32,14 @@ export default (lang, locale) => {
exclude: /node_modules/,
loader: StringReplacePlugin.replace({
replacements: [{
pattern: /"%i18n:(.+?)%"/g, replacement: (_, key) => {
return '"' + get(key).replace(/"/g, '\\"') + '"';
}
pattern: /"%i18n:(.+?)%"/g, replacement: (_, key) =>
'"' + get(key).replace(/"/g, '\\"') + '"'
}, {
pattern: /'%i18n:(.+?)%'/g, replacement: (_, key) => {
return '\'' + get(key).replace(/'/g, '\\\'') + '\'';
}
pattern: /'%i18n:(.+?)%'/g, replacement: (_, key) =>
'\'' + get(key).replace(/'/g, '\\\'') + '\''
}, {
pattern: /%i18n:(.+?)%/g, replacement: (_, key) => {
return get(key);
}
pattern: /%i18n:(.+?)%/g, replacement: (_, key) =>
get(key)
}]
})
};