lbry-desktop/ui/js/app.js

35 lines
673 B
JavaScript
Raw Normal View History

2017-06-20 14:08:52 +02:00
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)
2017-06-20 14:08:52 +02:00
: "en";
const i18n = require("y18n")({
directory: "app/locales",
updateFiles: false,
locale: language,
2017-06-06 06:21:55 +02:00
});
2017-04-07 07:15:22 +02:00
const logs = [];
const app = {
2017-06-20 14:08:52 +02:00
env: env,
config: config,
store: store,
i18n: i18n,
logs: logs,
log: function(message) {
console.log(message);
logs.push(message);
},
2017-06-06 06:21:55 +02:00
};
2016-11-22 21:19:08 +01:00
window.__ = i18n.__;
window.__n = i18n.__n;
2017-04-07 07:15:22 +02:00
global.app = app;
module.exports = app;