From ed40c644e01d7530efd18db9639ff443d9062041 Mon Sep 17 00:00:00 2001 From: Indranil Das Gupta Date: Wed, 27 Aug 2014 08:18:23 +0000 Subject: [PATCH 4/5] Bug 12815 [ENH] Patch #4 of 5 - Adding browser based multi-lingual jquery.ime input method support to Koha The original patch http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31152 is being split up into a 5-part patchset as per discussion on #koha This 4/5 adds the jQuery.IME support hooks for the Koha OPAC. It introduces a new syspref 'UsejQueryIMEonOPAC' and inserts into sysprefs.sql and updatedatabase.pl. The i18n_l10n.pref YAML file is also organised into topical sub-sections i.e. 'Date and Time', 'Language Support' and 'Multi-lingual keyboard'. Test Plan: 1) Apply patches 2) Update the database (so that the new system preference is inserted) 3) Go to Administration -> System Preferences -> I18N/L10N in the staff client. 4) Under "Multi-Lingual keyboard", "Enable" the UsejQueryIMEonOPAC system preference. Open the OPAC, and click inside the search box after page load. You should see small keyboard graphics attached to the bottom right edge of the search box. 5) Click on the keyboard graphics to expand the drop-down. Select your language. The drop-down will close. 6) Click again on the keyboard icon, it should now offer the list of input methods available for the language selected in step 5. 7) You should be able to type in your chosen input method. To switch back to English while on that page press CTRL+M. This toggles between input methods while on the page. 8) Repeating step #4 about to select "Do not enable", should disable jQuery.IME support. NOTE 1: For a language to work, the operating system should have UTF-8 support and in the case of Indic and other asian languages Complex layout rendering support and the necessary fonts. NOTE 2: A set of screenshot showing steps 5, 6 and 7 using the OPAC. (a) Default view with IM active - http://imgur.com/a/2gB7H#3 (b) Selecting the language - http://imgur.com/a/2gB7H#1 (c) Search box showing input method - http://imgur.com/a/2gB7H#0 (d) Typing using Hindi Inscript im - http://imgur.com/a/2gB7H#2 --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 ++ .../en/modules/admin/preferences/i18n_l10n.pref | 104 ++++++++++++--------- .../bootstrap/en/includes/doc-head-close.inc | 5 + .../bootstrap/en/includes/opac-bottom.inc | 12 +++ 5 files changed, 84 insertions(+), 45 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 7eb08a8..0244f45 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -425,6 +425,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('UseCourseReserves','0',NULL,'Enable the course reserves feature.','YesNo'), ('useDaysMode','Calendar','Calendar|Days|Datedue','Choose the method for calculating due date: select Calendar to use the holidays module, and Days to ignore the holidays module','Choice'), ('UseICU','0','1','Tell Koha if ICU indexing is in use for Zebra or not.','YesNo'), +('UsejQueryIMEonOPAC','0','','If ON, enables browser based, multi-lingual jQuery.ime based input methods on the OPAC','YesNo'), ('UseKohaPlugins','0','','Enable or disable the ability to use Koha Plugins.','YesNo'), ('UseQueryParser','0',NULL,'If enabled, try to use QueryParser for queries.','YesNo'), ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ad2f409..9e479c5 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8669,6 +8669,13 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.17.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('UsejQueryIMEonOPAC','0','','If ON, enables browser based, multi-lingual jQuery.ime based input methods on the OPAC','YesNo')"); + print "Upgrade to $DBversion done (Bug 12815 - Adding support of jquery.ime to Koha OPAC)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref index 02985d3..411bca8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref @@ -1,46 +1,60 @@ I18N/L10N: - - - - Format dates like - - pref: dateformat - default: us - choices: - us: mm/dd/yyyy - metric: dd/mm/yyyy - iso: yyyy-mm-dd - - . - - - - Format times in - - pref: TimeFormat - default: 24hr - choices: - 24hr: 24 hour format ( e.g. "14:18" ) - 12hr: 12 hour format ( e.g. "02:18 PM" ) - - . - - - - Use - - pref: CalendarFirstDayOfWeek - default: Sunday - choices: - Sunday: Sunday - Monday: Monday - - as the first day of week in the calendar. - - - - "Enable the following languages on the staff interface:" - - pref: language - type: staff-languages - - - - pref: opaclanguagesdisplay - default: 0 - choices: - yes: Allow - no: "Don't allow" - - patrons to change the language they see on the OPAC. - - - - "Enable the following languages on the OPAC:" - - pref: opaclanguages - type: opac-languages - - - - "Use the alphabet" - - pref: alphabet - class: long - - for lists of browsable letters. This should be a space separated list of uppercase letters. + Date and Time: + - + - Format dates like + - pref: dateformat + default: us + choices: + us: mm/dd/yyyy + metric: dd/mm/yyyy + iso: yyyy-mm-dd + - . + - + - Format times in + - pref: TimeFormat + default: 24hr + choices: + 24hr: 24 hour format ( e.g. "14:18" ) + 12hr: 12 hour format ( e.g. "02:18 PM" ) + - . + - + - Use + - pref: CalendarFirstDayOfWeek + default: Sunday + choices: + Sunday: Sunday + Monday: Monday + - as the first day of week in the calendar. + - + Language Support: + - + - "Enable the following languages on the staff interface:" + - pref: language + type: staff-languages + - + - pref: opaclanguagesdisplay + default: 0 + choices: + yes: Allow + no: "Don't allow" + - patrons to change the language they see on the OPAC. + - + - "Enable the following languages on the OPAC:" + - pref: opaclanguages + type: opac-languages + - + - "Use the alphabet" + - pref: alphabet + class: long + - for lists of browsable letters. This should be a space separated list of uppercase letters. + Multi-lingual keyboard: + - + - NOTE: jQuery.IME is a jQuery based input method editor supporting over 135 input methods across more than 62 languages. + - + - "Enable jQuery.IME " + - pref: UsejQueryIMEonOPAC + default: 0 + choices: + yes: Enable + no: "Do no enable" + - on the OPAC. diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc index c3e2d83..82becd5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc @@ -41,6 +41,11 @@ [% IF ( OPACUserCSS ) %][% END %] [% PROCESS cssinclude %] + +[% IF ( Koha.Preference('UsejQueryIMEonOPAC') ) %] + +[% END %] +