Bugzilla – Attachment 153717 Details for
Bug 34310
Input prompt in datatables column search boxes untranslatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34310: Input prompt in datatables column search boxes untranslatable
Bug-34310-Input-prompt-in-datatables-column-search.patch (text/plain), 2.11 KB, created by
Owen Leonard
on 2023-07-20 11:51:24 UTC
(
hide
)
Description:
Bug 34310: Input prompt in datatables column search boxes untranslatable
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-07-20 11:51:24 UTC
Size:
2.11 KB
patch
obsolete
>From 6c794abcbb2038ca2548c764f190828610cadc08 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 20 Jul 2023 11:24:23 +0000 >Subject: [PATCH] Bug 34310: Input prompt in datatables column search boxes > untranslatable > >This patch corrects the internationalization function wrapped around the >"% search" string in datatables.js. It should be the double-underscore >function instead of the single-underscore. > >To test, apply the patch and test that the placeholder string is >translatable. In this example I'm testing fr-FR: > >- Update a translation: > > > cd misc/translator > > perl translate update fr-FR > >- Open the corresponding .po file for the strings pulled from > JavaScript e.g. misc/translator/po/fr-FR-messages-js.po > - Locate strings pulled from prog/js/datatables.js for > translation, e.g.: > > \#: koha-tmpl/intranet-tmpl/prog/js/datatables.js:894 > \#, javascript-format > msgid "%s search" > msgstr "%s recherche" > > - Install the updated translation: > > > perl translate install fr-FR > >In the staff interface, test a page that has column header filters, e.g. >patron search. Confirm that the table of search results shows the >translated string in the column header placeholders. >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 8d79a44253..1252b7d210 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -891,7 +891,7 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { > if ( existing_search ) { > $(this).html( '<input type="text" value="%s" style="width: 100%" />'.format(existing_search) ); > } else { >- var search_title = _("%s search").format(title); >+ var search_title = __("%s search").format(title); > $(this).html( '<input type="text" placeholder="%s" style="width: 100%" />'.format(search_title) ); > } > } >-- >2.30.2
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 34310
:
153717
|
153742
|
155252