2022-05-05 13:56:17 +00:00
|
|
|
__webpack_public_path__ = _PUBLIC_PATH;
|
2016-09-24 14:32:31 +00:00
|
|
|
|
2022-11-17 23:31:45 +00:00
|
|
|
import 'promise-polyfill/src/polyfill';
|
2022-11-17 22:31:48 +00:00
|
|
|
import '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');
|
2016-11-14 09:47:39 +00:00
|
|
|
|
2022-05-05 13:56:17 +00:00
|
|
|
window.onload = function() {
|
|
|
|
loadLocale(main);
|
2017-11-29 10:01:48 +00:00
|
|
|
}
|
2016-11-14 09:47:39 +00:00
|
|
|
|
2022-11-17 22:31:48 +00:00
|
|
|
function main() {
|
2022-11-11 19:31:17 +00:00
|
|
|
Vn.setVersion(packageJson.version);
|
2022-11-17 22:31:48 +00:00
|
|
|
const hederaWeb = new Hedera.App();
|
|
|
|
window.hederaWeb = hederaWeb;
|
2022-05-05 13:56:17 +00:00
|
|
|
hederaWeb.run();
|
2016-09-26 09:28:47 +00:00
|
|
|
}
|
2016-09-24 14:32:31 +00:00
|
|
|
|
2022-11-17 22:31:48 +00:00
|
|
|
function loadLocale(callback) {
|
2022-05-05 13:56:17 +00:00
|
|
|
Vn.Locale.init();
|
2017-11-29 10:01:48 +00:00
|
|
|
var lang = Vn.Locale.language;
|
|
|
|
|
2022-05-05 13:56:17 +00:00
|
|
|
var req = require.context('js', true, /locale\/en.yml$/);
|
2022-11-17 22:31:48 +00:00
|
|
|
onLocaleLoad(Vn.Locale.fallbackLang, req);
|
|
|
|
|
|
|
|
const loadFn = locales[lang];
|
|
|
|
if (loadFn)
|
|
|
|
loadFn(function(req) {
|
|
|
|
onLocaleLoad(lang, req);
|
|
|
|
callback();
|
|
|
|
});
|
2022-11-16 01:44:39 +00:00
|
|
|
else
|
2022-11-17 22:31:48 +00:00
|
|
|
callback();
|
2016-09-27 06:18:20 +00:00
|
|
|
}
|
2018-01-03 15:35:03 +00:00
|
|
|
|
2022-11-17 22:31:48 +00:00
|
|
|
function onLocaleLoad(lang, req) {
|
2022-05-05 13:56:17 +00:00
|
|
|
var keys = req.keys();
|
2018-01-03 15:35:03 +00:00
|
|
|
|
|
|
|
for (var i = 0; i < keys.length; i++)
|
2022-11-17 22:31:48 +00:00
|
|
|
Vn.Locale.add(req(keys[i]), lang);
|
2018-01-03 15:35:03 +00:00
|
|
|
}
|