9e9088049c
Currently translating Javascript strings with variables in them is hard, because the strings are created from separate parts. For example: _("Are you sure you want to delete the") + " " + count + " " + _("attached items?") This is translated in two different parts, and the translator cannot affect the place where the count-variable is. Now, if the javascript strings allowed placeholders, similar to how the template strings do, the above could be written as: _("Are you sure you want to delete the %s attached items?").format(count) This would make translation much easier. Attached patch adds a Javascript string formatter, and changes all the concatenated translatable JS strings used in intranet to use that. To test: 1) cd misc/translator 2) perl translate update xx-YY 3) grep ^msgid po/xx-YY-i-staff-t-prog-v-3006000.po | sort | uniq > xx-YY-pre 4) apply patch 5) perl translate update xx-YY 6) grep ^msgid po/xx-YY-i-staff-t-prog-v-3006000.po | sort | uniq > xx-YY-post 7) compare the files: diff -Nurd xx-YY-pre xx-yy-post | less should show the javascript strings that changed. 8) Test the UIs where the formatted js strings are used. Signed-off-by: Owen Leonard <oleonard@myacpl.org> I tested *most* of the changed files. There were some instances where it wasn't clear to me how to trigger the warnings which were modified, especially tags/review.tt, admin/manage-marc-import.tt, and holidays.tt. Everything I was able to test worked correctly. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works nicely, no regressions found. Thx! Signed-off-by: Galen Charlton <gmc@esilibrary.com>
155 lines
7.8 KiB
Text
155 lines
7.8 KiB
Text
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Patron card creator › Manage images</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
function DeleteConfirm() {
|
|
var results = selected_images("delete");
|
|
if (results.images != -1) {
|
|
var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
|
|
var answer = confirm(msg);
|
|
if (answer) {
|
|
window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
|
|
}
|
|
else {
|
|
return; // abort delete
|
|
}
|
|
}
|
|
};
|
|
function selected_images(op) {
|
|
var selected = new Array;
|
|
var image_ids = new Array;
|
|
if (document.delete_images.action.length) {
|
|
for (i=0;i<document.delete_images.action.length;i++){
|
|
if (document.delete_images.action[i].checked){
|
|
selected.push("image_id=" + document.delete_images.action[i].value);
|
|
image_ids.push(document.delete_images.action[i].value);
|
|
}
|
|
};
|
|
images = selected.join("&");
|
|
return {images:images, image_ids:image_ids};
|
|
}
|
|
else if (document.delete_images.action.checked){
|
|
return {images:"batch_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
|
|
};
|
|
alert(_("Please select image(s) to %s.").format(op));
|
|
return (-1);
|
|
};
|
|
$(document).ready(function() {
|
|
$("#delete").click(function(){
|
|
return DeleteConfirm();
|
|
});
|
|
});
|
|
//]]>
|
|
</script>
|
|
</head>
|
|
<body id="pcard_image-manage" class="tools pcard">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
<div id="breadcrumbs">
|
|
<a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
|
|
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
|
|
<a href="/cgi-bin/koha/patroncards/home.pl">Patron card creator</a> ›
|
|
Manage images
|
|
</div>
|
|
<div id="doc3" class="yui-t2">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
[% INCLUDE 'patroncards-errors.inc' %]
|
|
<div class="yui-g">
|
|
<div class="yui-u first">
|
|
<h1>Upload Images</h1>
|
|
[% IF ( IMPORT_SUCCESSFUL ) %]
|
|
<div id="dialog" class="dialog message">
|
|
<h3>Image successfully uploaded</h3>
|
|
<ul><li>File: [% SOURCE_FILE %]</li>
|
|
<li>Image name: [% IMAGE_NAME %]</li></ul>
|
|
</div>
|
|
[% END %]
|
|
<form name="upload_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
|
|
<fieldset class="brief">
|
|
<div class="hint">
|
|
<b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported. Images <b>must</b> be less than 500KB.
|
|
</div>
|
|
<ol>
|
|
<li>
|
|
<label for="uploadfile">Select the file to upload: </label>
|
|
<input type="file" id="uploadfile" name="uploadfile" />
|
|
<input type="hidden" id="image" name="filetype" value="image" />
|
|
</li>
|
|
<li>
|
|
<label for="image_name">Image name: </label>
|
|
<div class="hint">
|
|
This will be the name by which you will refer to this image in the patron card layout editor.
|
|
</div>
|
|
<input type="text" id="image_name" name="image_name" size="20" />
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
<fieldset class="action">
|
|
<input type="hidden" name="op" value="upload" />
|
|
<input id="uploadsu" type="submit" value="Upload" />
|
|
<a id="cancelul" href="/cgi-bin/koha/patroncards/home.pl" class="cancel">Cancel</a>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
<div class="yui-u">
|
|
<h1>Delete Images</h1>
|
|
[% IF ( DELETE_SUCCESSFULL ) %]
|
|
<div id="dialog" class="dialog message">
|
|
<h3>Image(s) successfully deleted</h3>
|
|
</div>
|
|
[% END %]
|
|
[% IF ( TABLE ) %]
|
|
<form name="delete_images" method="post" action="/cgi-bin/koha/patroncards/image-manage.pl" enctype="multipart/form-data">
|
|
<fieldset class="brief">
|
|
<div class="hint">
|
|
Select one or more images to delete.
|
|
</div>
|
|
<table>
|
|
[% FOREACH TABL IN TABLE %]
|
|
[% IF ( TABL.header_fields ) %]
|
|
<tr>
|
|
[% FOREACH header_field IN TABL.header_fields %]
|
|
<th>[% header_field.field_label %]</th>
|
|
[% END %]
|
|
</tr>
|
|
[% ELSE %]
|
|
<tr>
|
|
[% FOREACH text_field IN TABL.text_fields %]
|
|
[% IF ( text_field.select_field ) %]
|
|
<td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td>
|
|
[% ELSIF ( text_field.field_value ) %]
|
|
<td>[% text_field.field_value %]</td>
|
|
[% ELSE %]
|
|
<td> </td>
|
|
[% END %]
|
|
[% END %]
|
|
</tr>
|
|
[% END %]
|
|
[% END %]
|
|
</table>
|
|
</fieldset>
|
|
<fieldset class="action">
|
|
<input type="hidden" name="op" value="delete" />
|
|
<input type="button" id="delete" value="Delete" />
|
|
<a id="canceldel" href="/cgi-bin/koha/patroncards/home.pl" class="cancel">Cancel</a>
|
|
</fieldset>
|
|
</form>
|
|
[% ELSE %]
|
|
<fieldset class="brief">
|
|
<div class="hint">
|
|
No images are currently available.
|
|
</div>
|
|
</fieldset>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="yui-b noprint">
|
|
[% INCLUDE 'patroncards-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|