wip
This commit is contained in:
parent
9b41023c43
commit
029b92935c
10 changed files with 49 additions and 312 deletions
27
locales/index.js
Normal file
27
locales/index.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* Languages Loader
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const loadLang = lang => yaml.safeLoad(
|
||||
fs.readFileSync(`./locales/${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;
|
Loading…
Add table
Add a link
Reference in a new issue