1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-01 16:28:33 +09:00
misskey/locales/index.ts
2018-05-17 09:28:31 +09:00

26 lines
472 B
TypeScript

/**
* 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'),
'fr': loadLang('fr'),
'ja': native,
'pl': loadLang('pl')
};
Object.entries(langs).map(([, locale]) => {
// Extend native language (Japanese)
locale = Object.assign({}, native, locale);
});
export default langs;