✌️
This commit is contained in:
parent
0711d29f6f
commit
da279f9e50
13 changed files with 104 additions and 32 deletions
23
locales/index.ts
Normal file
23
locales/index.ts
Normal file
|
|
@ -0,0 +1,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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue