summaryrefslogtreecommitdiff
path: root/webpack/langs.ts
blob: 409b25504a3bbdf77c35ce2c590fa4d47c14f02b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
 * 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;