Bugzilla – Attachment 110818 Details for
Bug 26441
Move translatable strings out of catalog-strings.inc into catalog.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26441: Move translatable strings out of catalog-strings.inc into catalog.js
Bug-26441-Move-translatable-strings-out-of-catalog.patch (text/plain), 9.43 KB, created by
David Nind
on 2020-09-27 10:01:41 UTC
(
hide
)
Description:
Bug 26441: Move translatable strings out of catalog-strings.inc into catalog.js
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-09-27 10:01:41 UTC
Size:
9.43 KB
patch
obsolete
>From c5a14359af85d17e7b084af297b7ead220923126 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 11 Sep 2020 19:39:08 +0000 >Subject: [PATCH] Bug 26441: Move translatable strings out of > catalog-strings.inc into catalog.js > >This patch moves translatable strings out of catalog-strings.inc into >catalog.js, wrapped in the double-underscore function for >translation. > >To test that each affected string correctly appears in the interface: > >- View the details for a bibliographic record which has items attached. >- From the Edit menu, choose "Delete record." You should get an alert, > "X item(s) are attached to this record. You must delete all items > before deleting this record." >- From the Edit menu, choose "Delete all items." You should get an > alert, "Are you sure you want to delete the X attached items?" > >- When logged in as a user with acquisitions and cataloging privileges, > view the details for a bibliographic record which is used in an order > in Acquisitions. Delete any items attached. >- Choose "Delete record" from the Edit menu. You should get an alert, > "Warning: This record is used in X order(s). Deleting it could cause > serious issues on acquisition module. Are you sure you want to delete > this record?" >- In Acquisitions, view a basket containing orders. Cancel the > order for a title in the basket. Open the detail page for the title in > the cancelled order. Try to delete it. You should get an confirmation, > "X deleted order(s) are using this record. Are you sure you want to > delete this record?" > - Perform the same test as a user with cataloging but not acquisitions > privileges. The alert should say "X deleted order(s) are using this > record. You need order managing permissions to delete this record." > >- When logged in as a user with cataloging but not acquisitions > privileges, view the details for a bibliographic record which is used > in an order in Acquisitions. Delete any items attached. >- Choose "Delete record" from the Edit menu. You should get an alert, "X > order(s) are using this record. You need order managing permissions to > delete this record." > >- View the details for a bibliographic record which has a hold. >- Choose "Delete all items" from the Edit menu. You should get an alert, > "X hold(s) on this record. You must delete all holds before deleting > all items." >- View the details for a bibliographic record which has no items. >- Choose "Delete record" from the Edit menu. You should get an alert, > "Are you sure you want to delete this record?" >- Choose "Edit items in a batch" from the Edit menu. You should get an > alert, "This record has no items." > >I could not find any instance of the PopupZ3950Confirmed function in >catalog.js being triggered so I don't think the associated string can be >tested. > >TESTING TRANSLATABILITY > >- Update a translation, e.g. fr-FR: > > > cd misc/translator > > perl translate update fr-FR > >- Open the corresponding .po file for JavaScript strings, e.g. > misc/translator/po/fr-FR-messages-js.po >- Locate strings pulled from > koha-tmpl/intranet-tmpl/prog/js/catalog.js for > translation, e.g.: > > msgid "This record has no items." > msgstr "" > >- Edit the "msgstr" string however you want (it's just for > testing). >- Install the updated translation: > > > perl translate install fr-FR > >- Switch to your newly translated language in the staff client > and repeat the test plan above. The translated strings should > appear. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/includes/catalog-strings.inc | 13 ----------- > koha-tmpl/intranet-tmpl/prog/js/catalog.js | 26 ++++++++++++---------- > 2 files changed, 14 insertions(+), 25 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >index 2313b932d0..d74261d089 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-strings.inc >@@ -1,19 +1,6 @@ > [% USE Context %] > <!-- catalog-strings.inc --> > <script> >- /* Strings for translation */ >- var MSG_REPLACE_RECORD = _("Please note that this external search could replace the current record."); >- var MSG_DELETE_ALL_ITEMS = _("%s item(s) are attached to this record. You must delete all items before deleting this record."); >- var CONFIRM_RECORD_USED_IN_ORDERS = _("Warning: This record is used in %s order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?"); >- var MSG_RECORD_USED_IN_ORDERS = _("%s order(s) are using this record. You need order managing permissions to delete this record."); >- var CONFIRM_IN_DELETED_ORDERS = _("%s deleted order(s) are using this record. Are you sure you want to delete this record?"); >- var MSG_IN_DELETED_ORDERS = _("%s deleted order(s) are using this record. You need order managing permissions to delete this record."); >- var CONFIRM_DELETION_HOLDS = _("%s holds(s) for this record. Are you sure you want to delete this record?"); >- var CONFIRM_RECORD_DELETION = _("Are you sure you want to delete this record?"); >- var MSG_DELETE_ALL_HOLDS = _("%s hold(s) on this record. You must delete all holds before deleting all items."); >- var CONFIRM_DELETE_ITEMS = _("Are you sure you want to delete the %s attached items?"); >- var MSG_NO_ITEMS = _("This record has no items."); >- > /* Some required variables from the template */ > var biblionumber = [% biblionumber | html %]; > var count = [% count | html %]; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/catalog.js b/koha-tmpl/intranet-tmpl/prog/js/catalog.js >index 96adfbe93b..af19ebe8c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/catalog.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/catalog.js >@@ -1,3 +1,5 @@ >+/* global __ biblionumber count holdcount countorders countdeletedorders searchid addRecord */ >+/* exported GetZ3950Terms PopupZ3950Confirmed */ > /* IF ( CAN_user_editcatalogue_edit_catalogue ) */ > /* this function open a popup to search on z3950 server. */ > function PopupZ3950() { >@@ -7,7 +9,7 @@ > } > } > function PopupZ3950Confirmed() { >- if (confirm( MSG_REPLACE_RECORD )){ >+ if (confirm( __("Please note that this external search could replace the current record.") )) { > PopupZ3950(); > } > } >@@ -24,23 +26,23 @@ function confirm_deletion(link) { > var order_manage_permission = $(link).data("order-manage"); > var is_confirmed; > if (count > 0){ >- is_confirmed = alert( MSG_DELETE_ALL_ITEMS.format(count) ); >+ is_confirmed = alert(__("%s item(s) are attached to this record. You must delete all items before deleting this record.").format(count)); > } else if (countorders > 0){ > if( order_manage_permission ){ >- is_confirmed = confirm( CONFIRM_RECORD_USED_IN_ORDERS.format(countorders) ); >+ is_confirmed = confirm(__("Warning: This record is used in %s order(s). Deleting it could cause serious issues on acquisition module. Are you sure you want to delete this record?").format(countorders)); > } else { >- is_confirmed = alert( MSG_RECORD_USED_IN_ORDERS.format(countorders) ); >+ is_confirmed = alert(__("%s order(s) are using this record. You need order managing permissions to delete this record.").format(countorders)); > } > } else if (countdeletedorders > 0){ > if( order_manage_permission ){ >- is_confirmed = confirm( CONFIRM_IN_DELETED_ORDERS.format(countdeletedorders) ); >+ is_confirmed = confirm(__("%s deleted order(s) are using this record. Are you sure you want to delete this record?").format(countdeletedorders)); > } else { >- is_confirmed = alert( MSG_IN_DELETED_ORDERS.format(countdeletedorders) ); >+ is_confirmed = alert(__("%s deleted order(s) are using this record. You need order managing permissions to delete this record.").format(countdeletedorders)); > } > } else if ( holdcount > 0 ) { >- is_confirmed = confirm( CONFIRM_DELETION_HOLDS.format(holdcount) ); >+ is_confirmed = confirm( __("%s holds(s) for this record. Are you sure you want to delete this record?").format(holdcount)); > } else { >- is_confirmed = confirm( CONFIRM_RECORD_DELETION ); >+ is_confirmed = confirm( __("Are you sure you want to delete this record?") ); > } > if (is_confirmed) { > $("#deletebiblio").unbind('click'); >@@ -56,9 +58,9 @@ function confirm_deletion(link) { > > function confirm_items_deletion() { > if ( holdcount > 0 ) { >- alert( MSG_DELETE_ALL_HOLDS.format(holdcount) ); >+ alert(__("%s hold(s) on this record. You must delete all holds before deleting all items.").format(holdcount)); > } else if ( count > 0 ) { >- if( confirm( CONFIRM_DELETE_ITEMS.format(count) ) ) { >+ if (confirm(__("Are you sure you want to delete the %s attached items?").format(count))) { > window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=" + biblionumber + (searchid ? "&searchid="+searchid : ""); > } else { > return false; >@@ -70,7 +72,7 @@ function confirm_items_deletion() { > } > > function alertNoItems(){ >- alert( MSG_NO_ITEMS ); >+ alert( __("This record has no items.") ); > } > > /* END IF CAN_user_editcatalogue_edit_items or ( frameworkcode == 'FA' and CAN_user_editcatalogue_fast_cataloging ) */ >@@ -110,4 +112,4 @@ $(document).ready(function() { > alertNoItems(); > }) > .tooltip(); >- }); >+}); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26441
:
110410
|
110818
|
110820