hedera-web/app.js

52 lines
977 B
JavaScript
Raw Normal View History

2016-09-24 14:32:31 +00:00
2016-09-26 09:28:47 +00:00
var Hedera = require ('hedera/hedera');
2016-09-24 14:32:31 +00:00
2016-09-27 06:18:20 +00:00
window.onload = function ()
2016-09-26 09:28:47 +00:00
{
2016-09-27 06:18:20 +00:00
Vn.Locale.init ();
var lang = Vn.Locale.language;
loadLocale (lang, main);
}
function main (req)
{
var keys = req.keys ();
for (var i = 0; i < keys.length; i++)
Vn.Locale.add (req (keys[i]));
2016-09-26 09:28:47 +00:00
hederaWeb = new Hedera.App ();
hederaWeb.run ();
}
2016-09-24 14:32:31 +00:00
2016-09-27 06:18:20 +00:00
function loadLocale (lang, cb)
{
switch (lang)
{
case 'ca':
2016-10-04 15:27:49 +00:00
require ([], function () {
2016-09-27 06:18:20 +00:00
cb (require.context ('locale/ca/js')); });
break;
case 'es':
2016-09-27 19:31:46 +00:00
require ([], function () {
2016-09-27 06:18:20 +00:00
cb (require.context ('locale/es/js')); });
break;
case 'fr':
2016-09-27 12:47:19 +00:00
require ([], function () {
2016-09-27 06:18:20 +00:00
cb (require.context ('locale/fr/js')); });
break;
case 'mn':
2016-09-27 12:47:19 +00:00
require ([], function () {
2016-09-27 06:18:20 +00:00
cb (require.context ('locale/mn/js')); });
break;
case 'pt':
2016-09-27 12:47:19 +00:00
require ([], function () {
2016-09-27 06:18:20 +00:00
cb (require.context ('locale/pt/js')); });
break;
default:
2016-09-27 12:47:19 +00:00
require ([], function () {
2016-09-27 06:18:20 +00:00
cb (require.context ('locale/en/js')); });
}
}