Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ
Pasi Kallinen 9e9088049c Bug 12138 - Use placeholders in translatable Javascript strings
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>
2014-04-27 21:24:04 +00:00
..
bookcount.tt Bug 11616: remove jQuery tablesorter plugin 2014-01-31 15:24:01 +00:00
branchoverdues.tt Bug 11359: Add the borrower's cardnumber and phonenumber to the branch overdues report 2014-03-10 20:25:26 +00:00
branchtransfers.tt
circulation-home.tt Bug 10493: Add renewal script 2013-10-22 17:04:03 +00:00
circulation.tt Bug 12107 - Move checkboxes jQuery plugin outside of language-specific directory 2014-04-25 15:12:20 +00:00
offline-mf.tt Bug 12118 - remove unnecessary YUI assets included in offline circ manifest 2014-04-25 15:25:34 +00:00
offline.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
overdue.tt Bug 11570 - Upgrade jQueryUI to latest version in the staff client 2014-04-07 15:37:27 +00:00
pendingreserves.tt Bug 11649 - Always use words "copy number" - intranet 2014-02-18 23:51:24 +00:00
printslip.tt Bug 10731: fix use of IntranetSlipPrinterJS by hold slips 2013-09-18 16:10:54 +00:00
renew.tt Bug 7413: (follow-up) teach renew interface about too_soon 2014-04-08 23:22:05 +00:00
reserveratios.tt Bug 11711 - Use new DataTables include in circ templates 2014-04-08 23:47:27 +00:00
returns.tt Bug 9448: (QA Followup) Hide 'Forgive overdue charges' for returns if user does not have writeoff permission 2014-04-17 15:43:01 +00:00
selectbranchprinter.tt Bug 10054 - When SingleBranchMode is enabled, allow superlibrarians to set logged in library 2013-05-12 10:11:42 -04:00
stats.tt
transfer-slip.tt Bug 9265 - Switch to HTML5 doctype in OPAC and staff client 2013-01-31 11:47:04 -05:00
transferstoreceive.tt Bug 11711 - Use new DataTables include in circ templates 2014-04-08 23:47:27 +00:00
view_holdsqueue.tt Bug 11711 - Use new DataTables include in circ templates 2014-04-08 23:47:27 +00:00
waitingreserves.tt Bug 11711 - Use new DataTables include in circ templates 2014-04-08 23:47:27 +00:00