Bugzilla – Attachment 109435 Details for
Bug 26339
Move translatable strings out of addorderiso2709.tt into addorderiso2709.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26339: Move translatable strings out of addorderiso2709.tt into addorderiso2709.js
Bug-26339-Move-translatable-strings-out-of-addorde.patch (text/plain), 4.43 KB, created by
Owen Leonard
on 2020-09-01 14:01:03 UTC
(
hide
)
Description:
Bug 26339: Move translatable strings out of addorderiso2709.tt into addorderiso2709.js
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-09-01 14:01:03 UTC
Size:
4.43 KB
patch
obsolete
>From 1ad783938e46a688acbdfed6e779be5a815012ea Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 1 Sep 2020 13:46:35 +0000 >Subject: [PATCH] Bug 26339: Move translatable strings out of > addorderiso2709.tt into addorderiso2709.js > >This patch moves strings defined for translation in addorderiso2709.tt >into addorderiso2709.js for translation using the new double-underscore >i81n function. > >To test, apply the patch and go to Acquisitions -> Vendor -> Basket -> >Add orders from MARC file. > > - Click "Add orders" next to a staged file. > - Without making any selections, click "Save." You should get an error, > "There is no record selected." > - Select a record and click "Save." You should get an error, "Some > budgets are not defined in item records." > - Enter a non-numeric value in the "Quantity" field and click "Save." > You should get an error, "1 quantity values are not filled in or are > not numbers." > >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/addorderiso2709.js for translation, > e.g.: > > msgid "Some budgets are not defined in item records" > 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. >--- > .../intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt | 6 ------ > koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js | 10 +++++----- > 2 files changed, 5 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >index 1ae8d429d4..f27ebfa848 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >@@ -18,12 +18,6 @@ > [% Asset.js("js/acq.js") | $raw %] > [% Asset.js("js/funds_sorts.js") | $raw %] > [% Asset.js("js/addorderiso2709.js") | $raw %] >-<script> >- var ERR_NO_RECORD_SELECTED = _("There is no record selected"); >- var ERR_INVALID_QUANTITY = _("quantity values are not filled in or are not numbers"); >- var ERR_FUNDS_MISSING = _("Some budgets are not defined in item records"); >- var MSG_LOADING = _("Loading"); >-</script> > </head> > > <body id="acq_addorderiso2709" class="acq"> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js b/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js >index 04b8851936..3211017af9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js >@@ -1,4 +1,4 @@ >-/* global dataTablesDefaults ERR_NO_RECORD_SELECTED ERR_INVALID_QUANTITY ERR_FUNDS_MISSING MSG_LOADING */ >+/* global dataTablesDefaults __ */ > > $(document).ready(function() { > $("#Aform").preventDoubleFormSubmit(); >@@ -50,7 +50,7 @@ $(document).ready(function() { > e.preventDefault(); > > if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) { >- alert( ERR_NO_RECORD_SELECTED ); >+ alert( __("There is no record selected") ); > return false; > } > >@@ -61,14 +61,14 @@ $(document).ready(function() { > } > }); > if ( error > 0 ) { >- alert( error + " " + ERR_INVALID_QUANTITY ); >+ alert(error + " " + __("quantity values are not filled in or are not numbers") ); > return false; > > } > > error = checkOrderBudgets(); > if ( error > 0 ) { >- alert( ERR_FUNDS_MISSING ); >+ alert( __("Some budgets are not defined in item records") ); > return false; > } > >@@ -88,7 +88,7 @@ $(document).ready(function() { > }); > $("#dataPreview").on("hidden.bs.modal", function(){ > $("#dataPreviewLabel").html(""); >- $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + MSG_LOADING + "</div>"); >+ $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + __("Loading") + "</div>"); > }); > }); > >-- >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 26339
:
109435
|
110812
|
110827