Koha/koha-tmpl/intranet-tmpl/prog/en/modules/labels
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
..
label-bib-search.tt
label-edit-batch.tt Bug 11946 - add table sorters to label batches 2014-03-31 14:22:26 +00:00
label-edit-layout.tt Bug 2835 - Inconsistent use of colon at the end of sentences 2013-04-02 09:03:42 -04:00
label-edit-profile.tt Bug 11363: make units in label printer profile form translatable 2014-01-17 15:09:55 +00:00
label-edit-template.tt
label-home.tt Bug 8061: Follow up - RTL CSS overrides (staff client) 2013-04-07 12:51:54 -04:00
label-manage.tt Bug 12138 - Use placeholders in translatable Javascript strings 2014-04-27 21:24:04 +00:00
label-print.tt Bug 8796 - patron cards not starting on designated card 2012-10-05 17:16:01 +02:00
result.tt Bug 12107 - Move checkboxes jQuery plugin outside of language-specific directory 2014-04-25 15:12:20 +00:00
search.tt Bug 2835 - Inconsistent use of colon at the end of sentences 2013-04-02 09:03:42 -04:00
spinelabel-home.tt
spinelabel-print.tt Bug 10850 - give quick spine label template page its own ID 2013-10-18 04:51:14 +00:00