This commit is contained in:
Juan Ferrer Toribio 2016-09-27 08:18:20 +02:00
parent 1659c32fee
commit 99fc0f9615
34 changed files with 119 additions and 87 deletions

44
app.js
View File

@ -2,9 +2,51 @@
var Hedera = require ('hedera/hedera');
Vn.includeCss ('pages/main/style.css');
window.onload = function main ()
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.ensure ([], function (){
cb (require.context ('locale/ca/js')); });
break;
case 'es':
require.ensure ([], function () {
cb (require.context ('locale/es/js')); });
break;
case 'fr':
require.ensure ([], function () {
cb (require.context ('locale/fr/js')); });
break;
case 'mn':
require.ensure ([], function () {
cb (require.context ('locale/mn/js')); });
break;
case 'pt':
require.ensure ([], function () {
cb (require.context ('locale/pt/js')); });
break;
default:
require.ensure ([], function () {
cb (require.context ('locale/en/js')); });
}
}

View File

@ -61,7 +61,7 @@ Hedera.Catalog = new Class
else
{
this.$('view-button').setProperties ({
image: 'view-grid',
icon: 'view-grid',
tip: _('Grid view')
});
this.view = Hedera.Catalog.View.LIST;

View File

@ -1,8 +1,6 @@
require ('sql/sql');
Vn.Locale.loadScript ('js/db.js');
Db = module.exports = {
Connection : require ('./connection')
,Result : require ('./result')

View File

@ -2,7 +2,6 @@
require ('htk/htk');
Vn.includeCss ('js/hedera/style.css');
Vn.Locale.loadScript ('js/hedera.js');
Hedera = module.exports = {
Login : require ('./login')

View File

@ -2,8 +2,6 @@
require ('db/db');
require ('./style.css');
Vn.Locale.loadScript ('js/htk.js');
Htk = module.exports = {
Widget : require ('./widget')
,Popup : require ('./popup')

View File

@ -58,10 +58,10 @@ module.exports =
callback (success);
}
,add: function (strings)
,add: function (translations)
{
for (var stringId in strings)
vnLocaleStrings[stringId] = strings[stringId];
for (var str in translations)
vnLocaleStrings[str] = translations[str];
}
}

View File

@ -415,5 +415,3 @@ Vn = module.exports = {
}
};
Vn.Locale.loadScript ('js/vn.js');

View File

@ -1,8 +1,7 @@
Vn.Locale.add
({
{
"ConnError": "Error en la conexió"
,"BadServerReply": "Resposta del servidor incorrecta"
,"ModelNotUpdatable": "Aquest model no és actualitzable"
,"RowNotExists": "El registre no existeix o ha sigut esborrat"
,"ColNotExists": "La columna no existeix"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"User": "Usuari"
,"Password": "Contrasenya"
,"Beta": "Beta"
@ -56,4 +55,4 @@ Vn.Locale.add
,"Configuration": "Configuració"
,"Account": "Compte"
,"Addresses": "Direccions"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"True": "Sí"
,"False": "No"
,"Null": "Nul"
@ -28,4 +27,4 @@ Vn.Locale.add
,"Next": "Següent"
,"Search": "Cercar"
,"Search...": "Cercar..."
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"Sunday": "Diumenge"
,"Monday": "Dilluns"
,"Tuesday": "Dimarts"
@ -43,4 +42,4 @@ Vn.Locale.add
,"Dec": "Des"
,"%A, %B %e": "%A, %e de %B"
});
}

View File

@ -1,8 +1,7 @@
Vn.Locale.add
({
{
"ConnError": "Connection failed"
,"BadServerReply": "Bad server reply"
,"ModelNotUpdatable": "Model not updatable"
,"RowNotExists": "The record does not exist or has been deleted"
,"ColNotExists": "The column does not exist"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"User": "User"
,"Password": "Password"
,"Beta": "Beta"
@ -56,4 +55,4 @@ Vn.Locale.add
,"Configuration": "Configuration"
,"Account": "Account"
,"Addresses": "Addresses"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"True": "True"
,"False": "False"
,"Null": "Null"
@ -28,4 +27,4 @@ Vn.Locale.add
,"Next": "Next"
,"Search": "Search"
,"Search...": "Search..."
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"Sunday": "Sunday"
,"Monday": "Monday"
,"Tuesday": "Tuesday"
@ -43,4 +42,4 @@ Vn.Locale.add
,"Dec": "Dic"
,"%A, %B %e": "%A, %B %e"
});
}

View File

@ -1,8 +1,7 @@
Vn.Locale.add
({
{
"ConnError": "Error en la conexión"
,"BadServerReply": "Respuesta del servidor incorrecta"
,"ModelNotUpdatable": "Este modelo no es actualizable"
,"RowNotExists": "El registro no existe o a sido borrado"
,"ColNotExists": "La columna no existe"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"User": "Usuario"
,"Password": "Contraseña"
,"Beta": "Beta"
@ -56,4 +55,4 @@ Vn.Locale.add
,"Configuration": "Configuración"
,"Account": "Cuenta"
,"Addresses": "Direcciones"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"True": "Si"
,"False": "No"
,"Null": "Nulo"
@ -28,4 +27,4 @@ Vn.Locale.add
,"Next": "Siguiente"
,"Search": "Buscar"
,"Search...": "Buscar..."
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"Sunday": "Domingo"
,"Monday": "Lunes"
,"Tuesday": "Martes"
@ -43,4 +42,4 @@ Vn.Locale.add
,"Dec": "Dic"
,"%A, %B %e": "%A, %e de %B"
});
}

View File

@ -1,8 +1,7 @@
Vn.Locale.add
({
{
"ConnError": "Échec de la connexion"
,"BadServerReply": "Réponse du serveur incorrecte"
,"ModelNotUpdatable": "Ce modèle n'est pas modifiable"
,"RowNotExists": "Le dossier n'existe pas ou a été supprimée"
,"ColNotExists": "N'existe pas la colonne"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"User": "Utilisateur"
,"Password": "Mot de passe"
,"Beta": "Beta"
@ -56,4 +55,4 @@ Vn.Locale.add
,"Configuration": "Configuration"
,"Account": "Compte"
,"Addresses": "Adresses"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"True": "Si"
,"False": "Aucun"
,"Null": "Nul"
@ -28,4 +27,4 @@ Vn.Locale.add
,"Next": "Suivant"
,"Search": "Recherche"
,"Search...": "Recherche..."
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"Sunday": "Dimanche"
,"Monday": "Lundi"
,"Tuesday": "Mardi"
@ -43,4 +42,4 @@ Vn.Locale.add
,"Dec": "Déc"
,"%A, %B %e": "%A, %B %e"
});
}

View File

@ -1,8 +1,7 @@
Vn.Locale.add
({
{
"ConnError": "Connection failed"
,"BadServerReply": "Bad server reply"
,"ModelNotUpdatable": "Model not updatable"
,"RowNotExists": "The record does not exist or has been deleted"
,"ColNotExists": "The column does not exist"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"User": "Хэрэглэгчийн"
,"Password": "нууц үг"
,"Beta": "Бета"
@ -56,4 +55,4 @@ Vn.Locale.add
,"Configuration": "Тохиргоо"
,"Account": "Дансны"
,"Addresses": "хаягууд"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"True": "True"
,"False": "False"
,"Null": "Null"
@ -28,4 +27,4 @@ Vn.Locale.add
,"Next": "Next"
,"Search": "хайх"
,"Search...": "хайх..."
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"Sunday": "Ням гараг"
,"Monday": "Даваа гариг"
,"Tuesday": "Мягмар"
@ -43,4 +42,4 @@ Vn.Locale.add
,"Dec": "Арв"
,"%A, %B %e": "%A, %B %e"
});
}

View File

@ -1,5 +1,5 @@
{
"Addresses": "Endereços
"Addresses": "Endereços"
,"Return": "Voltar"
,"AddAddress": "Adicionar Endereço"

View File

@ -1,8 +1,7 @@
Vn.Locale.add
({
{
"ConnError": "Erro de conexão"
,"BadServerReply": "Resposta do servidor incorreta"
,"ModelNotUpdatable": "Este modelo não é actualizável"
,"RowNotExists": "O Registro não existe ou foi apagado"
,"ColNotExists": "A Coluna não existe"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"User": "Usuario"
,"Password": "Palavra-Passe"
,"Beta": "Beta"
@ -56,4 +55,4 @@ Vn.Locale.add
,"Configuration": "Configuração"
,"Account": "Conta"
,"Addresses": "Endereços"
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"True": "Sim"
,"False": "Não"
,"Null": "Nulo"
@ -28,4 +27,4 @@ Vn.Locale.add
,"Next": "Seguinte"
,"Search": "Procurar"
,"Search...": "Procurar..."
});
}

View File

@ -1,5 +1,4 @@
Vn.Locale.add
({
{
"Sunday": "Domingo"
,"Monday": "Segunda-Feira"
,"Tuesday": "Terça-Feira"
@ -43,4 +42,4 @@ Vn.Locale.add
,"Dec": "Dez"
,"%A, %B %e": "%A, %B %e"
});
}

View File

@ -5,6 +5,7 @@
"devDependencies": {
"webpack": "*",
"webpack-dev-server": "*",
"split-by-name-webpack-plugin": "*",
"css-loader": "*",
"style-loader": "*",
"file-loader": "*",

View File

@ -1,4 +1,5 @@
var fs = require ('fs');
var webpack = require ('webpack');
module.exports =
@ -24,7 +25,26 @@ module.exports =
fallback: process.env.NODE_PATH
},
plugins: [
/*new webpack.optimize.UglifyJsPlugin ({minimize: true})*/
]
/* new webpack.IgnorePlugin (new RegExp ('.{2}/(forms|pages|rest)'))
new webpack.optimize.UglifyJsPlugin ({minimize: true})
*/ ]
};
/*
var configs = [];
var langs = fs.readdirSync ('./locale');
for (var lang in languages)
configs.push (
{
entry: './locale.js',
output: {
path: __dirname +'/build',
filename: 'lang.'+ lang +'.js'
},
module: {
loaders: [
{ test: /\.json$/, loader: 'json' }
]
}
});
*/