Bugzilla – Attachment 110781 Details for
Bug 26240
Move translatable strings out of sms_providers.tt and into sms_providers.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26240: Move translatable strings out of sms_providers.tt and into sms_providers.js
Bug-26240-Move-translatable-strings-out-of-smsprov.patch (text/plain), 4.39 KB, created by
David Nind
on 2020-09-26 10:44:44 UTC
(
hide
)
Description:
Bug 26240: Move translatable strings out of sms_providers.tt and into sms_providers.js
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-09-26 10:44:44 UTC
Size:
4.39 KB
patch
obsolete
>From fe80372a0ee2708a1ce6b6bffe0f534f47f9df76 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 18 Aug 2020 17:09:31 +0000 >Subject: [PATCH] Bug 26240: Move translatable strings out of sms_providers.tt > and into sms_providers.js > >This patch removes the definition of translatable strings out of >templates and into the corresponding JavaScript file, using the new JS >i81n function. > >To test you must have the SMSSendDriver preference populated ("Email" is >fine). > >- Apply the patch and go to Administration -> SMS cellular providers. >- Click "New SMS provider." >- The legend on the form's fieldset should read "Add an SMS cellular > provider." >- Add an SMS provider. >- Edit an SMS provider. >- The legend on the form's fieldset should read "Edit provider <provider > name>" >- If necessary, edit a patron's SMS settings to use one of your existing > SMS providers. >- From the list of SMS providers, click to delete the provider which is > in use. >- The error message should read "Are you sure you want to delete > <provider name>? <number> patron(s) are using it!" >- Click to delete a provider which isn't in use. The error message > should read "Are you sure you want to delete <provider>?" > >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/sms_providers.js for translation, > e.g.: > > msgid "Add an SMS cellular provider" > 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> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt | 6 ------ > koha-tmpl/intranet-tmpl/prog/js/sms_providers.js | 8 ++++---- > 2 files changed, 4 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt >index cad0641ed7..3983391274 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/sms_providers.tt >@@ -101,12 +101,6 @@ > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] >- <script> >- var MSG_SMS_PATRONS_USING = _("Are you sure you want to delete %s? %s patron(s) are using it!"); >- var MSG_SMS_DELETE_CONFIRM = _("Are you sure you want to delete %s?"); >- var LABEL_SMS_ADD_PROVIDER = _("Add an SMS cellular provider"); >- var LABEL_SMS_EDIT_PROVIDER = _("Edit provider %s"); >- </script> > [% Asset.js("js/sms_providers.js") | $raw %] > [% END %] > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/sms_providers.js b/koha-tmpl/intranet-tmpl/prog/js/sms_providers.js >index 3fe6f76fa5..47b20e4ffe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/sms_providers.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/sms_providers.js >@@ -33,7 +33,7 @@ function clear_form(){ > function add_provider(){ > clear_form(); > $(".dialog").hide(); >- $("legend").text( LABEL_SMS_ADD_PROVIDER ); >+ $("legend").text( __("Add an SMS cellular provider") ); > $("#toolbar,#submit_update,#providerst").hide(); > $("#sms_add_form,#submit_save").show(); > $("#name").focus(); >@@ -41,7 +41,7 @@ function add_provider(){ > > function edit_provider( id ) { > clear_form(); >- $("legend").text( LABEL_SMS_EDIT_PROVIDER.format( $("#name_" + id).text() ) ); >+ $("legend").text( __("Edit provider %s").format($("#name_" + id).text()) ); > $("#sms_add_form,#submit_update").show(); > > $("#id").val( id ); >@@ -64,9 +64,9 @@ function cancel_edit() { > function delete_provider( id, users ) { > var c; > if ( users ) { >- c = confirm( MSG_SMS_PATRONS_USING.format( $("#name_" + id).html(), users ) ); >+ c = confirm( __("Are you sure you want to delete %s? %s patron(s) are using it!").format($("#name_" + id).html(), users) ); > } else { >- c = confirm( MSG_SMS_DELETE_CONFIRM.format( $("#name_" + id).html() ) ); >+ c = confirm( __("Are you sure you want to delete %s?").format($("#name_" + id).html()) ); > } > > if ( c ) { >-- >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 26240
:
108532
|
110781
|
110787