summaryrefslogtreecommitdiff
path: root/locales/index.ts
blob: 0593af366c6b905e2422784720e812ff5adbbb45 (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 = {
	'en': loadLang('en'),
	'ja': native
};

Object.entries(langs).map(([, locale]) => {
	// Extend native language (Japanese)
	locale = Object.assign({}, native, locale);
});

export default langs;