From df3eb7c94696dc4639f430c3fcd7fcd9d6f5cb99 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 14 Apr 2020 11:52:17 +0000 Subject: [PATCH] Bug 25118: Return claims has some translation issues This patch adds the right function calls to checkouts.js so that English strings can be picked up by the translator. The resolution message has been reformatted so that it can be clear without including "on" and "by" in the middle of the string. To test you should have a patron with at least one return claim. Open the checkout page for that patron and open the "Claims" tab. Test the process of editing, deleting, and resolving claims. TESTING TRANSLATABILITY - Update a translation: > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for the staff client: misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from checkouts.js for translation, e.g.: #: koha-tmpl/intranet-tmpl/prog/js/checkouts.js:920 msgid "Double click to edit" msgstr "" - Edit the "msgstr" string however you want (it's just for testing). - Install the updated translation: > perl translate install fr-FR Switch to the udpated translation and test the functionality under the "Claims" tab again to confirm that your translated strings appear. Note that "untranslatable string" failures reported by the QA script are false positives. Signed-off-by: Bernardo Gonzalez Kriegel Works ok, 7 new strings, after translation and install translated strings found on koha-tmpl/intranet-tmpl/prog/xx-YY/js/locale_data.js Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index e18c2a24c9..8f93aadaf8 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -917,7 +917,7 @@ $(document).ready(function() { "sClass": "return-claim-notes-td", "mDataProp": function ( oObj ) { return '' + oObj.notes + '' - + ''; + + ''; } }, { @@ -940,26 +940,27 @@ $(document).ready(function() { "mDataProp": function ( oObj ) { if ( ! oObj.resolution ) return ""; - let desc = '' + oObj.resolution_data.lib + ' on ' + oObj.resolved_on + ''; - if (oObj.resolved_by_data) desc += ' by ' + ( oObj.resolved_by_data.firstname || "" ) + ( oObj.resolved_by_data.surname || "" ) + ''; + let desc = '' + oObj.resolution_data.lib + ' ('; + if (oObj.resolved_by_data) desc += '' + ( oObj.resolved_by_data.firstname || "" ) + " " + ( oObj.resolved_by_data.surname || "" ) + ''; + desc += ', ' + oObj.resolved_on + ')'; return desc; } }, { "mDataProp": function ( oObj ) { let delete_html = oObj.resolved_on - ? '
  • Delete
  • ' + ? '
  • ' + __("Delete") + '
  • ' : ""; let resolve_html = ! oObj.resolution - ? '
  • Resolve
  • ' + ? '
  • ' + __("Resolve") + '
  • ' : ""; return '
    ' - + ' ' + ' ' @@ -1001,8 +1002,8 @@ $(document).ready(function() { ' ' + ' ' + '
    ' - + ' Update' - + ' Cancel' + + ' ' + __("Update") + '' + + ' ' + __("Cancel") + '' + '
    '; elt.hide(); $(editor).insertAfter( elt ); -- 2.11.0