2017-04-07 07:15:22 +02:00
|
|
|
import store from 'store.js';
|
2017-06-01 17:02:02 +02:00
|
|
|
import lbry from './lbry.js';
|
2017-02-20 19:56:15 +01:00
|
|
|
|
2017-05-23 09:41:26 +02:00
|
|
|
const env = ENV;
|
2017-04-07 07:15:22 +02:00
|
|
|
const config = require(`./config/${env}`);
|
2017-06-03 13:27:37 +02:00
|
|
|
const language = lbry.getClientSetting('language') ? lbry.getClientSetting('language') : 'en';
|
|
|
|
const i18n = require('y18n')({directory: 'app/locales', updateFiles: false, locale: language});
|
2017-04-07 07:15:22 +02:00
|
|
|
const logs = [];
|
|
|
|
const app = {
|
|
|
|
env: env,
|
|
|
|
config: config,
|
|
|
|
store: store,
|
2017-06-02 18:40:26 +02:00
|
|
|
i18n: i18n,
|
2017-04-07 07:15:22 +02:00
|
|
|
logs: logs,
|
|
|
|
log: function(message) {
|
|
|
|
console.log(message);
|
|
|
|
logs.push(message);
|
2016-04-10 02:00:56 +02:00
|
|
|
}
|
2017-04-07 07:15:22 +02:00
|
|
|
}
|
2016-11-22 21:19:08 +01:00
|
|
|
|
2017-06-01 17:02:02 +02:00
|
|
|
window.__ = i18n.__;
|
|
|
|
window.__n = i18n.__n;
|
|
|
|
|
2017-04-07 07:15:22 +02:00
|
|
|
global.app = app;
|
2017-06-01 17:02:02 +02:00
|
|
|
module.exports = app;
|