Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members
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
..
boraccount.tt Bug 2546: make description of standard fine types translatable 2013-12-05 18:44:33 +00:00
deletemem.tt
files.tt
guarantor_search.tt
mancredit.tt Bug 11563: (follow-up) improve selector for adding noEnterSubmit to select elements 2014-04-11 18:04:36 +00:00
maninvoice.tt Bug 11563: (follow-up) improve selector for adding noEnterSubmit to select elements 2014-04-11 18:04:36 +00:00
member-flags.tt
member-password.tt Bug 11877 - Eliminate use of deprecated jQuery .live() method 2014-03-26 19:15:01 +00:00
member.tt Bug 10318: Show primary email in patron search results 2014-01-13 21:33:09 +00:00
memberentrygen.tt Bug 11563: (follow-up) improve selector for adding noEnterSubmit to select elements 2014-04-11 18:04:36 +00:00
members-update.tt Bug 10924: fix updating contact note from OPAC 2013-09-23 18:05:46 +00:00
moremember-brief.tt
moremember-print.tt Bug 11869: (follow-up) only display active fines 2014-04-18 14:55:36 +00:00
moremember-receipt.tt
moremember.tt Bug 12107 - Move checkboxes jQuery plugin outside of language-specific directory 2014-04-25 15:12:20 +00:00
notices.tt Bug 11605: fallback to default DataTables settings where possible 2014-03-10 19:05:51 +00:00
pay.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
paycollect.tt
printfeercpt.tt
printinvoice.tt Bug 10027: (follow-up) improve display of fine details on printed invoice 2013-09-08 06:24:39 +00:00
purchase-suggestions.tt Bug 11802 - corrects for the patron purchase suggestions page 2014-03-10 15:11:53 +00:00
readingrec.tt Bug 11717 - Use new DataTables include in member templates 2014-02-27 15:33:26 +00:00
routing-lists.tt
statistics.tt Bug 11717 - Use new DataTables include in member templates 2014-02-27 15:33:26 +00:00
update-child.tt Bug 11717 - Use new DataTables include in member templates 2014-02-27 15:33:26 +00:00