0
1
Fork 0
hedera-web-mindshore/app.js

39 lines
698 B
JavaScript
Raw Normal View History

2022-05-05 13:56:17 +00:00
__webpack_public_path__ = _PUBLIC_PATH;
2016-09-24 14:32:31 +00:00
2022-05-05 13:56:17 +00:00
require('hedera/hedera');
2022-11-16 01:44:39 +00:00
const locales = require('./import').locales;
2022-11-11 19:31:17 +00:00
const packageJson = require('./package.json');
2022-05-05 13:56:17 +00:00
window.onload = function() {
loadLocale(main);
}
2022-05-05 13:56:17 +00:00
function main(req) {
2022-11-11 19:31:17 +00:00
if (req) onLocaleLoad(req);
Vn.setVersion(packageJson.version);
2016-09-27 06:18:20 +00:00
2022-05-05 13:56:17 +00:00
hederaWeb = new Hedera.App();
hederaWeb.run();
2016-09-26 09:28:47 +00:00
}
2016-09-24 14:32:31 +00:00
2022-05-05 13:56:17 +00:00
function loadLocale(cb) {
Vn.Locale.init();
var lang = Vn.Locale.language;
2022-05-05 13:56:17 +00:00
var req = require.context('js', true, /locale\/en.yml$/);
onLocaleLoad(req);
2022-11-16 01:44:39 +00:00
const fn = locales[lang];
if (fn)
fn(cb);
else
cb();
2016-09-27 06:18:20 +00:00
}
2022-05-05 13:56:17 +00:00
function onLocaleLoad(req) {
var keys = req.keys();
for (var i = 0; i < keys.length; i++)
2022-05-05 13:56:17 +00:00
Vn.Locale.add(req(keys[i]));
}