lbry-desktop/ui/js/app.js
Jeremy Kauffman 5bec6accc2 mostly done
refactor modals and settings, clean-up CHANGELOG
2017-08-18 17:47:30 -04:00

35 lines
673 B
JavaScript

import store from "store.js";
import lbry from "./lbry.js";
import * as settings from "constants/settings";
const env = ENV;
const config = {
...require(`./config/${env}`),
};
const language = lbry.getClientSetting(settings.LANGUAGE)
? lbry.getClientSetting(settings.LANGUAGE)
: "en";
const i18n = require("y18n")({
directory: "app/locales",
updateFiles: false,
locale: language,
});
const logs = [];
const app = {
env: env,
config: config,
store: store,
i18n: i18n,
logs: logs,
log: function(message) {
console.log(message);
logs.push(message);
},
};
window.__ = i18n.__;
window.__n = i18n.__n;
global.app = app;
module.exports = app;