diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index de320d6ca1..0c5c8d6ebf 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -1097,6 +1097,11 @@ float : right; width: 100%; } +#translControl{ +float : left; +padding-left : .4em; +} + .clearfix:after { content: "."; display: block; diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index 2238fba449..eeed1a528e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -80,3 +80,8 @@ //]]> /cgi-bin/koha/unapi" /> + + + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc index b118d18e9c..058615b193 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -55,9 +55,9 @@ - " class="left" style="width: 35%; font-size: 111%;" /> + " class="left" style="width: 35%; font-size: 100%;"/>
- +
diff --git a/koha-tmpl/opac-tmpl/prog/en/js/googleindictransliteration.js b/koha-tmpl/opac-tmpl/prog/en/js/googleindictransliteration.js new file mode 100644 index 0000000000..414cadd54e --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/js/googleindictransliteration.js @@ -0,0 +1,29 @@ + // Load the Google Transliteration API + google.load("elements", "1", { + packages: "transliteration" + }); + + function onLoad() { + var options = { + sourceLanguage: 'en', + destinationLanguage: ['hi','kn','ml','ta','te'], + shortcutKey: 'ctrl+g', + transliterationEnabled: true + }; + + // Create an instance on TransliterationControl with the required + // options. + var control = + new google.elements.transliteration.TransliterationControl(options); + + // Enable transliteration in the textfields with the given ids. + var ids = [ "transl1" ]; + control.makeTransliteratable(ids); + + // Show the transliteration control which can be used to toggle between + // English and Hindi and also choose other destination language. + control.showControl('translControl'); + } + google.setOnLoadCallback(onLoad); + + diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 5a56db0387..1f4d8d5afc 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -56,4 +56,9 @@ $template->param( koha_news_count => $koha_news_count ); +# If GoogleIndicTransliteration system preference is On Set paramter to load Google's javascript in OPAC search screens +if (C4::Context->preference('GoogleIndicTransliteration')) { + $template->param('GoogleIndicTransliteration' => 1); +} + output_html_with_http_headers $input, $cookie, $template->output; diff --git a/opac/opac-search.pl b/opac/opac-search.pl index ae7f4ea37c..e1e66a9e94 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -640,4 +640,9 @@ if ($cgi->param('format') && $cgi->param('format') =~ /rss/) { $content_type = 'html' } +# If GoogleIndicTransliteration system preference is On Set paramter to load Google's javascript in OPAC search screens +if (C4::Context->preference('GoogleIndicTransliteration')) { + $template->param('GoogleIndicTransliteration' => 1); +} + output_with_http_headers $cgi, $cookie, $template->output, $content_type;