Bug 26334: Move translatable strings out of members-menu.inc into members-menu.js
This patch moves translatable strings out of members-menu.inc into
members-menu.js where they can be translated using the double-underscore
i18n function.
To test, apply the patch and go to Patrons.
- Expand the search options in the search header by clicking the [+]
link.
- Select "Date of birth" from the "Search fields" dropdown.
- A tooltip should appear above the search form, "Dates of birth
should be entered in the format..." with your current date format.
- Remove all "Adult" type patron categories but one.
- Check out to a child patron.
- From the "More" menu choose "Update child to adult patron."
- You should see a confirmation.
- From the checkout screen, from the "More" menu, choose "Renew patron"
- You should get a confirmation.
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-menu.js for translation,
e.g.:
msgid "Are you sure you want to renew this patron's registration?"
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.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f04ea65fa3)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
b7078ab3e3
commit
d1322bd422
|
|
@ -3,13 +3,6 @@
|
|||
[% USE Categories %]
|
||||
<!-- str/members-menu.inc -->
|
||||
<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 %]";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* 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 */
|
||||
/* global borrowernumber advsearch dateformat __ CAN_user_borrowers_edit_borrowers number_of_adult_categories destination Sticky */
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
|
|
@ -106,13 +106,13 @@ function searchfield_date_tooltip(filter) {
|
|||
if ( $(type).val() == 'dateofbirth' ) {
|
||||
var MSG_DATE_FORMAT = "";
|
||||
if( dateformat == 'us' ){
|
||||
MSG_DATE_FORMAT = MSG_DATE_FORMAT_US;
|
||||
MSG_DATE_FORMAT = __("Dates of birth should be entered in the format 'MM/DD/YYYY'");
|
||||
} else if( dateformat == 'iso' ){
|
||||
MSG_DATE_FORMAT = MSG_DATE_FORMAT_ISO;
|
||||
MSG_DATE_FORMAT = __("Dates of birth should be entered in the format 'YYYY-MM-DD'");
|
||||
} else if( dateformat == 'metric' ){
|
||||
MSG_DATE_FORMAT = MSG_DATE_FORMAT_METRIC;
|
||||
MSG_DATE_FORMAT = __("Dates of birth should be entered in the format 'DD/MM/YYYY'");
|
||||
} else if( dateformat == 'dmydot' ){
|
||||
MSG_DATE_FORMAT = MSG_DATE_FORMAT_DMYDOT;
|
||||
MSG_DATE_FORMAT = __("Dates of birth should be entered in the format 'DD.MM.YYYY'");
|
||||
}
|
||||
$(field).attr("title", MSG_DATE_FORMAT).tooltip('show');
|
||||
} else {
|
||||
|
|
@ -121,7 +121,7 @@ function searchfield_date_tooltip(filter) {
|
|||
}
|
||||
|
||||
function confirm_updatechild() {
|
||||
var is_confirmed = window.confirm( MSG_CONFIRM_UPDATE_CHILD );
|
||||
var is_confirmed = window.confirm( __("Are you sure you want to update this child to an Adult category? This cannot be undone.") );
|
||||
if (is_confirmed) {
|
||||
window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=' + borrowernumber;
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ function update_child() {
|
|||
}
|
||||
|
||||
function confirm_reregistration() {
|
||||
var is_confirmed = window.confirm( MSG_CONFIRM_RENEW_PATRON );
|
||||
var is_confirmed = window.confirm( __("Are you sure you want to renew this patron's registration?") );
|
||||
if (is_confirmed) {
|
||||
window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=' + borrowernumber + '&destination=' + destination + '&reregistration=y';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue