From f81de35028472fa518bee1618d49da9113bd062e Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 1 Apr 2017 04:40:52 +0900 Subject: [PATCH] #381 --- webpack.config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webpack.config.ts b/webpack.config.ts index d4a3ff09d9..182b223271 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -10,15 +10,19 @@ import * as yaml from 'js-yaml'; import version from './src/version'; const constants = require('./src/const.json'); -const languages = { +let languages = { 'en': yaml.safeLoad(fs.readFileSync('./locales/en.yml', 'utf-8')), 'ja': yaml.safeLoad(fs.readFileSync('./locales/ja.yml', 'utf-8')) }; +const native = languages.ja; + const env = process.env.NODE_ENV; const isProduction = env === 'production'; module.exports = (Object as any).entries(languages).map(([lang, locale]) => { + locale = Object.assign(native, locale); + const pack /*: webpack.Configuration ← fuck wrong type definition!!! */ = { name: lang, entry: { @@ -48,7 +52,7 @@ module.exports = (Object as any).entries(languages).map(([lang, locale]) => { }); if (error) { console.warn(`key '${key}' not found in '${lang}'`); - return '-UNTRANSLATED-'; + return key; } else { return text.replace(/'/g, '\\\'').replace(/"/g, '\\"'); }