diff --git a/webpack/module/rules/i18n.ts b/webpack/module/rules/i18n.ts index 873e08e1a0..aa4e58448f 100644 --- a/webpack/module/rules/i18n.ts +++ b/webpack/module/rules/i18n.ts @@ -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) }] }) };