wip #313
This commit is contained in:
parent
abb8e021ba
commit
d850b157f4
5 changed files with 55 additions and 15 deletions
|
@ -30,11 +30,11 @@ module.exports = (Object as any).entries(languages).map(([lang, locale]) => {
|
|||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.*$/,
|
||||
test: /\.(tag|js)$/,
|
||||
exclude: /node_modules/,
|
||||
loader: StringReplacePlugin.replace({
|
||||
replacements: [
|
||||
{ pattern: /'i18n:(.+?)'/g, replacement: (_, text) => locale[text] }
|
||||
{ pattern: /%i18n:(.+?)%/g, replacement: (_, text) => eval('locale' + text.split('.').map(x => `['${x}']`).join('')) }
|
||||
]
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue