mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-26 11:57:34 -07:00
Refactor
This commit is contained in:
parent
5666f0981f
commit
e68767cf02
1 changed files with 6 additions and 9 deletions
|
@ -32,17 +32,14 @@ export default (lang, locale) => {
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: StringReplacePlugin.replace({
|
loader: StringReplacePlugin.replace({
|
||||||
replacements: [{
|
replacements: [{
|
||||||
pattern: /"%i18n:(.+?)%"/g, replacement: (_, key) => {
|
pattern: /"%i18n:(.+?)%"/g, replacement: (_, key) =>
|
||||||
return '"' + get(key).replace(/"/g, '\\"') + '"';
|
'"' + get(key).replace(/"/g, '\\"') + '"'
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
pattern: /'%i18n:(.+?)%'/g, replacement: (_, key) => {
|
pattern: /'%i18n:(.+?)%'/g, replacement: (_, key) =>
|
||||||
return '\'' + get(key).replace(/'/g, '\\\'') + '\'';
|
'\'' + get(key).replace(/'/g, '\\\'') + '\''
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
pattern: /%i18n:(.+?)%/g, replacement: (_, key) => {
|
pattern: /%i18n:(.+?)%/g, replacement: (_, key) =>
|
||||||
return get(key);
|
get(key)
|
||||||
}
|
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue