Bugzilla – Attachment 106025 Details for
Bug 25320
Move translatable strings out of merge-record-strings.inc into merge-record.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25320: Move translatable strings out of merge-record-strings.inc into merge-record.js
Bug-25320-Move-translatable-strings-out-of-merge-r.patch (text/plain), 4.65 KB, created by
Owen Leonard
on 2020-06-18 15:49:12 UTC
(
hide
)
Description:
Bug 25320: Move translatable strings out of merge-record-strings.inc into merge-record.js
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-06-18 15:49:12 UTC
Size:
4.65 KB
patch
obsolete
>From 43a1dbd5889edc2e15102d297a5649a282e947ee Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 18 Jun 2020 14:28:38 +0000 >Subject: [PATCH] Bug 25320: Move translatable strings out of > merge-record-strings.inc into merge-record.js > >This patch eliminates the use of a separate include file containing >translatable strings in favor of embedding translatable strings in the >JavaScript itself. > >To test, apply the patch and clear your browser cache if necessary. > > - Perform a catalog search in the staff interface. > - Select two results to merge. Click Edit -> Merge records. > - Click "Next" on the "Merging records" page. > - On the "Source records" page click the second tab where all the > checkboxes are unchecked. > - Check the box for a tag which is non-repeatable, e.g. 245. > - You should see a message, "The field is non-repeatable and > already exists in the destination record. Therefore, you cannot add it." > - Check the box for a subfield which is non-repeatable, e.g. 245$a. > - You should see a message, "The subfield is non-repeatable and > already exists in the destination record. Therefore, you cannot > add it." > >TESTING TRANSLATABILITY > > - Update a translation, e.g. fr-FR: > > > cd misc/translator > > perl translate update fr-FR > > - Open the corresponding .po file for JavaScript strings, e.g. > misc/translator/po/fr-FR-messages-js.po > - Locate strings pulled from prog/js/merge-record.js for > translation, e.g.: > > #: koha-tmpl/intranet-tmpl/prog/js/merge-record.js:72 > msgctxt "Bibliographic record" > msgid "" > "The field is non-repeatable and already exists in the destination > record. " > "Therefore, you cannot add it." > msgstr "" > > - Edit the "msgstr" string however you want (it's just for testing). > - Install the updated translation: > > > perl translate install fr-FR > > - Switch to your newly translated language in the staff client and > repeat the test plan above. The translated string should appear. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/merge-record-strings.inc | 7 ------- > koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt | 1 - > koha-tmpl/intranet-tmpl/prog/js/merge-record.js | 4 ++-- > 3 files changed, 2 insertions(+), 10 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/merge-record-strings.inc > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record-strings.inc >deleted file mode 100644 >index 5cab76f232..0000000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record-strings.inc >+++ /dev/null >@@ -1,7 +0,0 @@ >-[%# transletable strings for merge-record.js %] >-<!-- merge-record-strings.inc --> >-<script> >- var MSG_MERGEREC_ALREADY_EXISTS = _("The field is non-repeatable and already exists in the destination record. Therefore, you cannot add it."); >- var MSG_MERGEREC_SUBFIELD_ALREADY_EXISTS = _("The subfield is non-repeatable and already exists in the destination record. Therefore, you cannot add it."); >-</script> >-<!-- / merge-record-strings.inc --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt >index 82120de729..67c8e6771b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt >@@ -181,7 +181,6 @@ div#result { margin-top: 1em; } > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/merge-record.js") | $raw %] >- [% INCLUDE 'merge-record-strings.inc' %] > <script> > [% UNLESS (result) %] > [% IF (choosereference) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/merge-record.js b/koha-tmpl/intranet-tmpl/prog/js/merge-record.js >index d8938b99b9..ec6d9eafdf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/merge-record.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/merge-record.js >@@ -69,7 +69,7 @@ function field_can_be_added($sources, $li) { > } > > if ((!repeatable) && (tag in target_record)) { >- alert(MSG_MERGEREC_ALREADY_EXISTS); >+ alert( __p("Bibliographic record", "The field is non-repeatable and already exists in the destination record. Therefore, you cannot add it.") ); > return false; > } > >@@ -104,7 +104,7 @@ function subfield_can_be_added($sources, $li) { > for (i in target_field.subfields) { > var subfield = target_field.subfields[i]; > if (code == subfield.code) { >- alert(MSG_MERGEREC_SUBFIELD_ALREADY_EXISTS); >+ alert( __p("Bibliographic record", "The subfield is non-repeatable and already exists in the destination record. Therefore, you cannot add it.") ); > return false; > } > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25320
:
106025
|
110575
|
110627
|
110901