forked from verdnatura/hedera-web
52 lines
977 B
JavaScript
52 lines
977 B
JavaScript
|
|
var Hedera = require ('hedera/hedera');
|
|
|
|
window.onload = function ()
|
|
{
|
|
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]));
|
|
|
|
hederaWeb = new Hedera.App ();
|
|
hederaWeb.run ();
|
|
}
|
|
|
|
function loadLocale (lang, cb)
|
|
{
|
|
switch (lang)
|
|
{
|
|
case 'ca':
|
|
require ([], function () {
|
|
cb (require.context ('locale/ca/js')); });
|
|
break;
|
|
case 'es':
|
|
require ([], function () {
|
|
cb (require.context ('locale/es/js')); });
|
|
break;
|
|
case 'fr':
|
|
require ([], function () {
|
|
cb (require.context ('locale/fr/js')); });
|
|
break;
|
|
case 'mn':
|
|
require ([], function () {
|
|
cb (require.context ('locale/mn/js')); });
|
|
break;
|
|
case 'pt':
|
|
require ([], function () {
|
|
cb (require.context ('locale/pt/js')); });
|
|
break;
|
|
default:
|
|
require ([], function () {
|
|
cb (require.context ('locale/en/js')); });
|
|
}
|
|
}
|
|
|