Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools
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
..
batchMod-del.tt Bug 12107 - Move checkboxes jQuery plugin outside of language-specific directory 2014-04-25 15:12:20 +00:00
batchMod-edit.tt Bug 12107 - Move checkboxes jQuery plugin outside of language-specific directory 2014-04-25 15:12:20 +00:00
batchMod.tt Bug 9533: batch item modification form now shows default field values only by request 2013-07-05 15:52:26 +00:00
cleanborrowers.tt Bug 11352: fix unexpected data loss issues with batch patron deletion/anonymization 2014-03-22 13:55:28 +00:00
csv-profiles.tt Bug 12094: fix default tab selection broken by jQueryUI upgrade 2014-04-22 14:51:18 +00:00
export.tt
holidays.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
import_borrowers.tt Bug 10861: Add a check on cardnumber length 2014-03-12 02:16:18 +00:00
inventory.tt Bug 12107 - Move checkboxes jQuery plugin outside of language-specific directory 2014-04-25 15:12:20 +00:00
koha-news.tt Bug 7567: (follow-up) Modify DataTables configuration 2014-04-07 18:14:20 +00:00
letter.tt Bug 11497: remove TT construct for picking a default string that i18n toolchain fails to pick up 2014-04-27 21:23:01 +00:00
manage-marc-import.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
marc_modification_templates.tt Bug 11414: warn user about dangerous MARC modification rules 2013-12-23 16:06:57 +00:00
modborrowers.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
overduerules.tt
picture-upload.tt Bug 9310 - Patron image upload template corrections 2013-01-17 21:53:42 -05:00
quotes-upload.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
quotes.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
scheduler.tt
stage-marc-import.tt Bug 8015: Add MARC Modifications Templates 2013-10-31 22:47:08 +00:00
tools-home.tt Bug 8015: QA Followup 2013-10-31 22:50:39 +00:00
upload-images.tt Bug 11785 - Use validation plugin when uploading local cover images 2014-02-20 16:56:21 +00:00
viewlog.tt Bug 11477: (follow-up) improve display of user/patrons in logs tool 2014-01-17 06:06:53 +00:00