This commit is contained in:
syuilo
2017-12-17 04:02:30 +09:00
parent 0711d29f6f
commit da279f9e50
13 changed files with 104 additions and 32 deletions

View File

@ -1,23 +0,0 @@
/**
* Languages Loader
*/
import * as fs from 'fs';
import * as yaml from 'js-yaml';
const loadLang = lang => yaml.safeLoad(
fs.readFileSync(`./locales/${lang}.yml`, 'utf-8'));
const native = loadLang('ja');
const langs = Object.entries({
'en': loadLang('en'),
'ja': native
});
langs.map(([, locale]) => {
// Extend native language (Japanese)
locale = Object.assign({}, native, locale);
});
export default langs;

View File

@ -5,10 +5,10 @@
import module_ from './module';
import plugins from './plugins';
import langs from './langs';
import langs from '../locales';
import version from '../src/version';
module.exports = langs.map(([lang, locale]) => {
module.exports = Object.entries(langs).map(([lang, locale]) => {
// Chunk name
const name = lang;