Bugzilla – Attachment 108688 Details for
Bug 26244
Move translatable strings out of memberentrygen.tt and into JavaScript
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26243: Move translatable strings out of memberentrygen.tt and into JavaScript
Bug-26243-Move-translatable-strings-out-of-membere.patch (text/plain), 5.69 KB, created by
Owen Leonard
on 2020-08-19 18:09:08 UTC
(
hide
)
Description:
Bug 26243: Move translatable strings out of memberentrygen.tt and into JavaScript
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-08-19 18:09:08 UTC
Size:
5.69 KB
patch
obsolete
>From 2f5f27058ef275fdfb34fa4660e10ed39342bed7 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 19 Aug 2020 00:48:54 +0000 >Subject: [PATCH] Bug 26243: Move translatable strings out of memberentrygen.tt > and into JavaScript > >This patch removes the definition of translatable strings out of >templates and into the corresponding JavaScript file, using the new JS >i81n function. > >Note: I was unable to trigger the confirmation message in the >check_form_borrowers function. I think the form is now structured in a >way that it is never triggered, thus a candidate for removal. > >To test: > >- Apply the patch and go to Patrons. >- Add or edit a patron. >- Select a date of birth at least one month in the past and confirm that > the patron's age is displayed in the hint below. >- Test multiple variations to confirm that the singular and plural of > 'year' and 'month' display correctly. (e.g. 1 year 9 months, 2 years, > etc). >- Set some patron messaging preferences for the patron. >- Change the patron category. >- You should get a confirmation: "Change messaging preferences to > default for this category?" > >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 > koha-tmpl/intranet-tmpl/prog/js/members.js for translation, e.g.: > > msgid "%s years" > 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 strings should > appear. > >https://bugs.koha-community.org/show_bug.cgi?id=26244 >--- > .../prog/en/modules/members/memberentrygen.tt | 17 ----------------- > koha-tmpl/intranet-tmpl/prog/js/members.js | 8 ++++---- > .../intranet-tmpl/prog/js/messaging-preference-form.js | 2 +- > 3 files changed, 5 insertions(+), 22 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index fbbb91a669..a5bd2a6be5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -1681,23 +1681,6 @@ legend:hover { > }); > }); > >- var MSG_SEPARATOR = _("Separator must be / in field %s"); >- var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); >- var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s"); >- var MSG_INCORRECT_YEAR = _("Invalid year entered in field %s"); >- var MSG_DUPLICATE_PATRON = _("Warning: Duplicate patron"); >- var MSG_DUPLICATE_ORGANIZATION = _("Warning: Duplicate organization"); >- var MSG_LATE_EXPIRY = _("Warning: Expiration date falls before enrollment date"); >- var MSG_DUPLICATE_SUSPICION = _("Please confirm whether this is a duplicate patron"); >- var MSG_MONTH = _("%s month") >- var MSG_MONTHS = _("%s months") >- var MSG_YEAR = _("%s year") >- var MSG_YEARS = _("%s years") >- var LABEL_CHANGE = _("Change"); >- var LABEL_SET_TO_PATRON = _("Set to patron"); >- var LABEL_AGE = _("Age"); >- var MSG_MESSAGING_DFEAULTS = _("Change messaging preferences to default for this category?"); >- > [% IF quickadd && opadd && !check_member %] > $(document).ready(function () { > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 07632256e1..d208bc6bc0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -17,7 +17,7 @@ function check_form_borrowers(nav){ > //patrons form to test if you checked no to the question of double > if (statut!=1 && document.form.check_member.value > 0 ) { > if (!(document.form.answernodouble.checked)){ >- message_champ+= MSG_DUPLICATE_SUSPICION; >+ message_champ += __("Please confirm whether this is a duplicate patron"); > statut=1; > document.form.nodouble.value=0; > } else { >@@ -158,16 +158,16 @@ function write_age() { > > var age_string; > if (age.year || age.month) { >- age_string = LABEL_AGE + ": "; >+ age_string = __("Age") + ": "; > } > > if (age.year) { >- age_string += age.year > 1 ? MSG_YEARS.format(age.year) : MSG_YEAR.format(age.year); >+ age_string += age.year > 1 ? __("%s years").format(age.year) : __("%s year").format(age.year); > age_string += " "; > } > > if (age.month) { >- age_string += age.month > 1 ? MSG_MONTHS.format(age.month) : MSG_MONTH.format(age.month); >+ age_string += age.month > 1 ? __("%s months").format(age.month) : __("%s month").format(age.month); > } > > hint.html(age_string); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js >index ea01a62d80..079c1dd935 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js >@@ -13,7 +13,7 @@ $(document).ready(function(){ > messaging_prefs_loading.show(); > var categorycode = $(this).val(); > if (message_prefs_dirty) { >- if (!confirm( MSG_MESSAGING_DFEAULTS )) { >+ if (!confirm( __("Change messaging preferences to default for this category?") )) { > // Not loading messaging defaults. Hide loading indicator > messaging_prefs_loading.hide(); > return; >-- >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 26244
:
108688
|
126581
|
131540
|
132806