diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/locales2-conf smeserver-manager-0.1.0/root/etc/e-smith/events/actions/locales2-conf --- smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/locales2-conf 2020-08-08 18:57:00.000000000 +0400 +++ smeserver-manager-0.1.0/root/etc/e-smith/events/actions/locales2-conf 2020-08-17 20:07:18.746000000 +0400 @@ -57,8 +57,9 @@ my $long_pm = I18NMODULES . "/$module/$lang". '.pm'; if ( -f $long_pm ) { - # .pm file newer than .lex + # .pm file not newer than .lex next if ((stat($long_lex))[9] < (stat($long_pm))[9]); + print "locales2: error cp\n" unless system("cp -f $long_pm ${long_pm}.svg") == 0; } open(FIL, '>:encoding(UTF-8)', $long_pm) @@ -68,9 +69,9 @@ print FIL "use strict;\nuse warnings;\nuse utf8;\nuse Mojo::Base 'SrvMngr::I18N';\n\n"; print FIL "use SrvMngr::I18N::Modules::General::${lang};\n\nmy %lexicon = (\n"; - #------------------------- + #-------------------- # copy lexicon to pm - #------------------------- + #-------------------- open(FIL2, '<:encoding(UTF-8)', $long_lex) or die "Couldn't open ", $long_lex, " for reading.\n"; while ( ) { @@ -83,6 +84,20 @@ print FIL " %lexicon\n);\n\n\n1;\n"; close FIL; - print "Lexicon $lang for $module ($lex) written to ${lang}.pm\n"; + + #------------------------- + # eval and restore if NOT OK + #------------------------- + if ( eval "use lib '".I18NMODULES."/../../../'; require '$long_pm';" ) { + print "Lexicon $lang for $module ($lex) written to ${lang}.pm\n"; + if ( -f ${long_pm}.'.svg' ) { + print "locales2: error rm" unless system("rm -f ${long_pm}.svg") == 0; + } + } else { + print "ERROR: Lexicon $lang for $module ($lex) NOT written to ${lang}.pm\n"; + if ( -f ${long_pm}.'.svg' ) { + print "locales2: error mv" unless system("mv -f ${long_pm}.svg $long_pm") == 0; + } + } } } diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/routes2-conf smeserver-manager-0.1.0/root/etc/e-smith/events/actions/routes2-conf --- smeserver-manager-0.1.0.old/root/etc/e-smith/events/actions/routes2-conf 2020-08-08 18:57:00.000000000 +0400 +++ smeserver-manager-0.1.0/root/etc/e-smith/events/actions/routes2-conf 2020-08-11 20:14:04.215000000 +0400 @@ -65,7 +65,7 @@ if (defined $method and defined $url and defined $ctlact and defined $name) { - my $key = $file2.'_'.$name; + my $key = $file2.'+'.$name; my $rec = $rtdb->get($key) || $rtdb->new_record($key, { type => 'route' } ); diff -aurN smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex --- smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex 2020-08-08 18:57:00.000000000 +0400 +++ smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_en.lex 2020-08-16 22:45:23.398000000 +0400 @@ -136,4 +136,7 @@ 'FM_MAC_ADDRESS1' => 'You must provide a MAC address.', 'FM_MAC_ADDRESS2' => 'The MAC address you provided was not valid.', 'FM_ERR_UNEXPECTED_DESC' => 'Error: unexpected or missing characters in description', -'swt_THEME' => 'Theme', +swt_THEME => 'Theme', +acs_NO => 'Not Authorized', +acs_LOGIN => 'Login required', +acs_ADMIN => 'Admin rights required', diff -aurN smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_fr.lex smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_fr.lex --- smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_fr.lex 2020-08-08 18:57:00.000000000 +0400 +++ smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/General/general_fr.lex 2020-08-16 22:45:46.255000000 +0400 @@ -136,3 +136,6 @@ 'FM_MAC_ADDRESS1' => 'Vous devez taper une adresse Ethernet.', 'FM_MAC_ADDRESS2' => 'L\'adresse Ethernet que vous avez tapé n\'est pas valide.', 'FM_ERR_UNEXPECTED_DESC' => 'ERREUR : caractères invalides ou manquants dans la description.', +acs_NO => 'Non autorisé', +acs_LOGIN => 'Connexion obligatoire', +acs_ADMIN => 'Droits d\'administration requis', diff -aurN smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr.pm smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr.pm --- smeserver-manager-0.1.0.old/root/usr/share/smanager/lib/SrvMngr.pm 2020-08-08 18:57:00.000000000 +0400 +++ smeserver-manager-0.1.0/root/usr/share/smanager/lib/SrvMngr.pm 2020-08-16 22:44:45.920000000 +0400 @@ -118,7 +118,7 @@ $self->helper( 'auth_fail' => sub { my $self = shift; - my $message = shift || "Not Authorized"; + my $message = shift || $self->l('acs_NO'); $self->flash( error => $message ); $self->redirect_to( $self->home_page ); return 0; @@ -188,7 +188,7 @@ my $if_logged_in = $r->under( sub { my $c =shift; - return $c->is_logged_in || $c->auth_fail($c->l("Login required")); + return $c->is_logged_in || $c->auth_fail($c->l("acs_LOGIN")); }); $if_logged_in->get('/review')->to('review#main')->name('review'); $if_logged_in->get('/logout')->to('logout#logout')->name('logout'); @@ -197,7 +197,7 @@ my $if_admin = $r->under( sub { my $c =shift; - return $c->is_admin || $c->auth_fail($c->l("Admin rights required")); + return $c->is_admin || $c->auth_fail($c->l("acs_ADMIN")); }); $if_admin->get('/backup')->to('backup#main')->name('backup');