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');
|
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-05-05 13:56:17 +00:00
|
|
|
function main(req) {
|
2018-01-03 15:35:03 +00:00
|
|
|
if (req)
|
2022-05-05 13:56:17 +00:00
|
|
|
onLocaleLoad(req);
|
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();
|
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$/);
|
|
|
|
onLocaleLoad(req);
|
2018-01-03 15:35:03 +00:00
|
|
|
|
2022-05-05 13:56:17 +00:00
|
|
|
switch (lang) {
|
2016-09-27 06:18:20 +00:00
|
|
|
case 'ca':
|
2022-05-05 13:56:17 +00:00
|
|
|
require([], function() {
|
|
|
|
cb(require.context('js', true, /locale\/ca.yml$/));
|
|
|
|
});
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
case 'es':
|
2022-05-05 13:56:17 +00:00
|
|
|
require([], function() {
|
|
|
|
cb(require.context('js', true, /locale\/es.yml$/));
|
|
|
|
});
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
case 'fr':
|
2022-05-05 13:56:17 +00:00
|
|
|
require([], function() {
|
|
|
|
cb(require.context('js', true, /locale\/fr.yml$/));
|
|
|
|
});
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
case 'mn':
|
2022-05-05 13:56:17 +00:00
|
|
|
require([], function() {
|
|
|
|
cb(require.context('js', true, /locale\/mn.yml$/));
|
|
|
|
});
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
case 'pt':
|
2022-05-05 13:56:17 +00:00
|
|
|
require([], function() {
|
|
|
|
cb(require.context('js', true, /locale\/pt.yml$/));
|
|
|
|
});
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
default:
|
2022-05-05 13:56:17 +00:00
|
|
|
cb();
|
2016-09-27 06:18:20 +00:00
|
|
|
}
|
|
|
|
}
|
2018-01-03 15:35:03 +00:00
|
|
|
|
2022-05-05 13:56:17 +00:00
|
|
|
function onLocaleLoad(req) {
|
|
|
|
var keys = req.keys();
|
2018-01-03 15:35:03 +00:00
|
|
|
|
|
|
|
for (var i = 0; i < keys.length; i++)
|
2022-05-05 13:56:17 +00:00
|
|
|
Vn.Locale.add(req(keys[i]));
|
2018-01-03 15:35:03 +00:00
|
|
|
}
|