summaryrefslogtreecommitdiff
path: root/locales/index.js
blob: f11ce7b57fc422acb04235bc2e7856c35c3b4557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * Languages Loader
 */

const fs = require('fs');
const yaml = require('js-yaml');

const loadLang = lang => yaml.safeLoad(
	fs.readFileSync(`${__dirname}/${lang}.yml`, 'utf-8'));

const native = loadLang('ja');

const langs = {
	'de': loadLang('de'),
	'en': loadLang('en'),
	'fr': loadLang('fr'),
	'ja': native,
	'pl': loadLang('pl'),
	'es': loadLang('es')
};

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

module.exports = langs;