Browse Source

Bug 17268: (follow-up) Fix translatability

This patch moves the error messages to translatable strings

Also includes capitalization fixes and POD adjustment

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Nick Clemens 2 years ago
committed by Martin Renvoize
parent
commit
c34eb3c950
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      Koha/AdvancedEditorMacro.pm
  2. 6
      Koha/AdvancedEditorMacros.pm
  3. 2
      api/v1/swagger/parameters/advancededitormacro.json
  4. 49
      koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc

2
Koha/AdvancedEditorMacro.pm

@ -24,7 +24,7 @@ use base qw(Koha::Object);
=head1 NAME
Koha::AdvancedEditorMacro - Koha Advanced Editor Macro Object class
Koha::AdvancedEditorMacro - Koha Advanced editor macro object class
=head1 API

6
Koha/AdvancedEditorMacros.pm

@ -26,7 +26,7 @@ use base qw(Koha::Objects);
=head1 NAME
Koha::AdvancedEditorMacros - Koha Advanced Editor Macro Object set class
Koha::AdvancedEditorMacros - Koha Advanced editor macro object set class
=head1 API
@ -42,6 +42,10 @@ sub _type {
return 'AdvancedEditorMacro';
}
=head3 object_class
=cut
sub object_class {
return 'Koha::AdvancedEditorMacro';
}

2
api/v1/swagger/parameters/advancededitormacro.json

@ -2,7 +2,7 @@
"advancededitormacro_id_pp": {
"name": "advancededitormacro_id",
"in": "path",
"description": "Advanced Editor Macro internal identifier",
"description": "Advanced editor macro internal identifier",
"required": true,
"type": "integer"
}

49
koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc

@ -715,7 +715,15 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
showSavedMacros();
})
.fail(function(err) {
humanMsg.displayAlert( _("Failed to delete macro:") + err.responseText, { className: 'humanError' } );
var err_message;
if( err.status == "404" ){
err_message = "Macro not found";
} else if ( err.status == "403" ){
err_message = _("You do not have permission to delete this macro");
} else {
err_message = _("There was a problem, please check the logs");
}
humanMsg.displayAlert( _("Failed to delete macro: " + err_message), { className: 'humanError' } );
});
}
@ -761,7 +769,15 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
macroEditor.activeMacroShared = result.shared;
})
.fail(function(err) {
humanMsg.displayAlert( _("Failed to load macros:") + err.responseText, { className: 'humanError' } );
var err_message;
if( err.status == "404" ){
err_message = "Macro not found";
} else if ( err.status == "403" ){
err_message = _("You do not have permission to access this macro");
} else {
err_message = _("There was a problem, please check the logs");
}
humanMsg.displayAlert( _("Failed to load macros: ") + err_message, { className: 'humanError' } );
});
}
@ -796,7 +812,13 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
})
.fail(function(err) {
humanMsg.displayAlert( _("Failed to create macro:") + err.responseText, { className: 'humanError' } );
var err_message;
if( err.status == "403" ){
err_message = _("You do not have permission to create this macro");
} else {
err_message = _("There was a problem, please check the logs");
}
humanMsg.displayAlert( _("Failed to create macro: ") + err_message, { className: 'humanError' } );
});
} );
}
@ -833,7 +855,8 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
});
})
.fail(function(err) {
humanMsg.displayAlert( _("Failed to load macros:") + err.responseText, { className: 'humanError' } );
var err_message = _("There was a problem, please check the logs");
humanMsg.displayAlert( _("Failed to load macros: ") + err_message, { className: 'humanError' } );
});
var $new_li = $( '<li class="new-macro"><a href="#">' + _("New macro...") + '</a></li>' );
$new_li.click( function() {
@ -859,7 +882,13 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
loadMacro( result.name, result.macro_id );
})
.fail(function(err) {
humanMsg.displayAlert( _("Failed to create macro:") + err.responseText, { className: 'humanError' } );
var err_message;
if( err.status == "403" ){
err_message = _("You do not have permission to access this macro");
} else {
err_message = _("There was a problem, please check the logs");
}
humanMsg.displayAlert( _("Failed to create macro: ") + err_message, { className: 'humanError' } );
});
} );
$('#macro-list').append($new_li);
@ -895,7 +924,15 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr
showSavedMacros();
})
.fail(function(err) {
humanMsg.displayAlert( _("Failed to save macro:") + err.responseText, { className: 'humanError' } );
var err_message;
if( err.status == "404" ){
err_message = _("Macro not found");
} else if ( err.status ="403" ){
err_message = _("You do not have permission to access this macro");
} else {
err_message = _("There was a problem, please check the logs");
}
humanMsg.displayAlert( _("Failed to save macro: ") + err_message, { className: 'humanError' } );
});
}

Loading…
Cancel
Save