parent
6c95120023
commit
f052d8912b
16 changed files with 155 additions and 306 deletions
|
@ -66,6 +66,7 @@ const consts = {
|
|||
_CODENAME_: codename,
|
||||
_LANG_: '%lang%',
|
||||
_LANGS_: Object.keys(locales).map(l => [l, locales[l].meta.lang]),
|
||||
_LOCALE_: '%locale%',
|
||||
_ENV_: process.env.NODE_ENV
|
||||
};
|
||||
|
||||
|
@ -100,6 +101,7 @@ const plugins = [
|
|||
|
||||
src = src.replace(i18nReplacer.pattern, i18nReplacer.replacement);
|
||||
src = src.replace('%lang%', lang);
|
||||
src = src.replace('"%locale%"', JSON.stringify(locales[lang]));
|
||||
|
||||
fs.writeFileSync(`${__dirname}/built/client/assets/${file}.${version}.${lang}.js`, src, 'utf-8');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue