Bugzilla – Attachment 89748 Details for
Bug 22904
Untranslatable strings in members-menu.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22904: Untranslatable strings in members-menu.js
Bug-22904-Untranslatable-strings-in-members-menujs.patch (text/plain), 6.54 KB, created by
Owen Leonard
on 2019-05-14 14:39:04 UTC
(
hide
)
Description:
Bug 22904: Untranslatable strings in members-menu.js
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-05-14 14:39:04 UTC
Size:
6.54 KB
patch
obsolete
>From 19a839397142fedd5c1a8eef2bdbd4491a057f86 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 14 May 2019 13:43:12 +0000 >Subject: [PATCH] Bug 22904: Untranslatable strings in members-menu.js > >This patch moves several English strings out of members-menu.js and into >str/members-menu.inc where they can be picked up by the translation >process. The following strings are affected: > >"Are you sure you want to renew this patron's registration?" >"Are you sure you want to update this child to an Adult category? This >cannot be undone." >"Dates of birth should be entered in the format 'MM/DD/YYYY'" >"Dates of birth should be entered in the format 'YYYY-MM-DD'" >"Dates of birth should be entered in the format 'DD/MM/YYYY'" >"Dates of birth should be entered in the format 'DD.MM.YYYY'" > >This patch also makes a correction to members-toolbar.inc in order to >enable the presence of the "Update child to Adult" menu item. > >To test: > > - Install and update a language. > - Check the po-file for that language. You should find no msgid for > the strings listed above. > - Apply the patch. > - Update the language you installed. > - You should find entries for all the strings above. > - Translate those messages and update the translated templates. > - Reinstall the translation. > >In the staff client: > > - Select your updated translation. > - Open an expired patron's account and choose "Renew patron" from the > "More" button in the toolbar. You should be prompted for confirmation > using the translation you provided. > - To test the "Update child" confirmation you should have only one > patron category in the "Adult" category. > - Open a patron record with a child category and choose "Update > child" from the "More" menu in the toolbar. You should be prompted > for confirmation using the translation you provided. > - To test the date format messages: From the patrons home page, expand > the advanced search options in the header search form. Select "Date > of birth" under "Search fields." A correctly-translated tooltip > should appear above the search field. >--- > .../intranet-tmpl/prog/en/includes/members-toolbar.inc | 1 + > .../intranet-tmpl/prog/en/includes/str/members-menu.inc | 7 +++++++ > koha-tmpl/intranet-tmpl/prog/js/members-menu.js | 14 +++++++------- > 3 files changed, 15 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index a86c976..e725db6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -4,6 +4,7 @@ > [% USE Branches %] > [% USE Categories %] > [% USE AuthorisedValues %] >+[% USE scalar %] > <div id="toolbar" class="btn-toolbar"> > [% IF CAN_user_borrowers_edit_borrowers %] > [% IF ( guarantor ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc >index 2d5ebfe..9268f7a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc >@@ -3,6 +3,13 @@ > [% USE Categories %] > > <script> >+ var MSG_CONFIRM_RENEW_PATRON = _("Are you sure you want to renew this patron's registration?"); >+ var MSG_CONFIRM_UPDATE_CHILD = _("Are you sure you want to update this child to an Adult category? This cannot be undone."); >+ var MSG_DATE_FORMAT_US = _("Dates of birth should be entered in the format 'MM/DD/YYYY'"); >+ var MSG_DATE_FORMAT_ISO = _("Dates of birth should be entered in the format 'YYYY-MM-DD'"); >+ var MSG_DATE_FORMAT_METRIC = _("Dates of birth should be entered in the format 'DD/MM/YYYY'"); >+ var MSG_DATE_FORMAT_DMYDOT = _("Dates of birth should be entered in the format 'DD.MM.YYYY'"); >+ > var advsearch = "[% advsearch | html %]"; > var destination = "[% destination | html %]"; > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >index f5b912b..235467d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js >@@ -1,4 +1,4 @@ >-/* global borrowernumber advsearch dateformat _ CAN_user_borrowers_edit_borrowers number_of_adult_categories destination */ >+/* global borrowernumber advsearch dateformat _ CAN_user_borrowers_edit_borrowers number_of_adult_categories destination Sticky MSG_DATE_FORMAT_US MSG_DATE_FORMAT_ISO MSG_DATE_FORMAT_METRIC MSG_DATE_FORMAT_DMYDOT MSG_CONFIRM_UPDATE_CHILD MSG_CONFIRM_RENEW_PATRON */ > > $(document).ready(function(){ > $("#filteraction_off, #filteraction_on").on('click', function(e) { >@@ -19,13 +19,13 @@ $(document).ready(function(){ > var MSG_DATE_FORMAT = ""; > if ( $(this).val() == 'dateofbirth' ) { > if( dateformat == 'us' ){ >- MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'MM/DD/YYYY'"); >+ MSG_DATE_FORMAT = MSG_DATE_FORMAT_US; > } else if( dateformat == 'iso' ){ >- MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'YYYY-MM-DD'"); >+ MSG_DATE_FORMAT = MSG_DATE_FORMAT_ISO; > } else if( dateformat == 'metric' ){ >- MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD/MM/YYYY'"); >+ MSG_DATE_FORMAT = MSG_DATE_FORMAT_METRIC; > } else if( dateformat == 'dmydot' ){ >- MSG_DATE_FORMAT = _("Dates of birth should be entered in the format 'DD.MM.YYYY'"); >+ MSG_DATE_FORMAT = MSG_DATE_FORMAT_DMYDOT; > } > $('#searchmember').attr("title", MSG_DATE_FORMAT).tooltip('show'); > } else { >@@ -105,7 +105,7 @@ $(document).ready(function(){ > }); > > function confirm_updatechild() { >- var is_confirmed = window.confirm(_("Are you sure you want to update this child to an Adult category? This cannot be undone.")); >+ var is_confirmed = window.confirm( MSG_CONFIRM_UPDATE_CHILD ); > if (is_confirmed) { > window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=' + borrowernumber; > } >@@ -120,7 +120,7 @@ function update_child() { > } > > function confirm_reregistration() { >- var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?")); >+ var is_confirmed = window.confirm( MSG_CONFIRM_RENEW_PATRON ); > if (is_confirmed) { > window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=' + borrowernumber + '&destination=' + destination + '&reregistration=y'; > } >-- >2.1.4
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 22904
:
89748
|
90117
|
90120