This is available only on the masthead search box in the OPAC.
User has to enter a word in english and press space or return to transliterate the word. The destination language can be selected from a drop down list. User can temporarily turn on/off the feature by using "ctrl +g".
A system preference - GoogleIndicTransliteration can be used to turn on this feature.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
width: 100%;
}
+#translControl{
+float : left;
+padding-left : .4em;
+}
+
.clearfix:after {
content: ".";
display: block;
//]]>
</script><!-- /TMPL_IF -->
<link rel="unapi-server" type="application/xml" title="unAPI" href="<!-- TMPL_VAR NAME="OPACBaseURL" -->/cgi-bin/koha/unapi" />
+<!-- TMPL_IF NAME="GoogleIndicTransliteration" -->
+ <script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript" language="javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/googleindictransliteration.js"></script>
+<!-- /TMPL_IF -->
+
<option value="callnum">Call Number</option>
<!-- /TMPL_IF --></select>
<!-- TMPL_IF NAME="ms_value" -->
- <input type="text" name="q" value="<!-- TMPL_VAR ESCAPE="HTML" NAME="ms_value" -->" class="left" style="width: 35%; font-size: 111%;" />
+ <input type="text" id = "transl1" name="q" value="<!-- TMPL_VAR ESCAPE="HTML" NAME="ms_value" -->" class="left" style="width: 35%; font-size: 100%;"/><div id="translControl"></div>
<!-- TMPL_ELSE -->
- <input type="text" name="q" class="left" style="width: 35%; font-size: 111%;" />
+ <input type="text" id = "transl1" name="q" class="left" style="width: 35%; font-size: 100%;"/><div id="translControl"></div>
<!-- /TMPL_IF -->
<!-- TMPL_UNLESS NAME="opac_limit_override" -->
<!-- TMPL_IF name="mylibraryfirst" -->
--- /dev/null
+ // 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);
+
+
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;
$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;