[OPEN-ILS-DEV] PATCH: Enable translation of slimpac
Dan Scott
denials at gmail.com
Mon Jul 23 23:59:06 EDT 2007
The attached patch enables the slimpac (the accessible, basic HTML
version of the OPAC), to support various translations of the search
forms by reusing the existing opac.dtd.
There are a few extra strings that we'll have to translate for
complete fr-CA support, but it's mostly there.
Note that the search _results_ are not yet i18n-ized; there's a fair
bit of work remaining there (thanks unAPI!). Also note that the method
used here changes the slimpac path from /opac/extras/slimpac/ to
/opac/ll-LL/extras/slimpac/ - although I do, of course, include a
redirect from the old /opac/extras/slimpac/ to
/opac/en-US/extras/slimpac/.
Finally, also note that the locale passing method may be subject to
change, or at least become more flexible, when OpenSRF sessions learn
about locales.
Developer's Certificate of Origin 1.1 By making a contribution to this
project, I certify that:
(a) The contribution was created in whole or in part by me and I have
the right to submit it under the open source license indicated in the
file; or
(b) The contribution is based upon previous work that, to the best of
my knowledge, is covered under an appropriate open source license and
I have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under the
same open source license (unless I am permitted to submit under a
different license), as indicated in the file; or
(c) The contribution was provided directly to me by some other person
who certified (a), (b) or (c) and I have not modified it; and
(d) In the case of each of (a), (b), or (c), I understand and agree
that this project and the contribution are public and that a record of
the contribution (including all personal information I submit with it,
including my sign-off) is maintained indefinitely and may be
redistributed consistent with this project or the open source license
indicated in the file.
--
Dan Scott
Laurentian University
-------------- next part --------------
Index: Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- Open-ILS/web/opac/locale/en-US/opac.dtd (revision 7571)
+++ Open-ILS/web/opac/locale/en-US/opac.dtd (working copy)
@@ -560,7 +560,10 @@
<!ENTITY common.email.enable "Enable email notifications for this hold?">
<!ENTITY common.email.none "(Patron has no configured email address)">
<!ENTITY common.email.set "(See <a class='classic_link' id='holds.no_email.my_account'>My Account</a> for setting your email address)">
+<!ENTITY common.keywords.label "Keywords:">
<!ENTITY common.physical.label "Physical Description:">
+<!ENTITY common.series.label "Series:">
+<!ENTITY common.subject.label "Subject:">
<!ENTITY common.title.label "Title:">
<!ENTITY common.author.label "Author:">
<!ENTITY common.format.label "Format:">
@@ -583,3 +586,17 @@
<!ENTITY login.failed "Login failed. The username or password provided was not valid.
Ensure Caps-Lock is off and try again or contact your local library.">
<!ENTITY button.go "Go!">
+
+<!-- =================================================================
+ Slimpac Simple Search
+ ================================================================= -->
+<!ENTITY slimpac.start.title "Simple Search">
+<!ENTITY slimpac.start.nowSearching "Now searching: ">
+<!ENTITY slimpac.start.dynamic "Dynamic Catalog">
+
+<!-- =================================================================
+ Slimpac Advanced Search
+ ================================================================= -->
+<!ENTITY slimpac.advanced.language "Item Language">
+<!ENTITY slimpac.advanced.create_date "Record Creation Date">
+<!ENTITY slimpac.advanced.edit_date "Record Edit Date">
Index: Open-ILS/web/opac/locale/fr-CA/opac.dtd
===================================================================
--- Open-ILS/web/opac/locale/fr-CA/opac.dtd (revision 7571)
+++ Open-ILS/web/opac/locale/fr-CA/opac.dtd (working copy)
@@ -529,7 +529,10 @@
<!ENTITY common.email.enable "Activer les avis par courrier ??lectronique pour cette mise en r??serve?">
<!ENTITY common.email.none "(Le client n'a pas d'adresse ??lectronique configur??e)">
<!ENTITY common.email.set "(Voir <a cat??gorie='lien_classique' id='r??serve.pas_adresse_??lectronique.mon_compte>Mon compte </a> pour ??tablir votre adresse ??lectronique)">
+<!ENTITY common.keywords.label "Mot-cl?? :">
<!ENTITY common.physical.label "Description physique :">
+<!ENTITY common.series.label "Collection :">
+<!ENTITY common.subject.label "Sujet :">
<!ENTITY common.title.label "Titre :">
<!ENTITY common.author.label "Auteur :">
<!ENTITY common.format.label "Format :">
@@ -552,3 +555,20 @@
V??rifier que la touche des majuscules n'est pas verrouill??e et essayez de nouveau ou communiquez avec votre biblioth??que locale.">
<!ENTITY button.go "Aller!">
+<!-- =================================================================
+ Slimpac Simple Search
+ ================================================================= -->
+<!-- START: TO BE TRANSLATED -->
+<!ENTITY slimpac.start.title "Simple Search">
+<!ENTITY slimpac.start.nowSearching "Recherche en cours : ">
+<!ENTITY slimpac.start.dynamic "Dynamic Catalog">
+<!-- END: TO BE TRANSLATED -->
+
+<!-- =================================================================
+ Slimpac Advanced Search
+ ================================================================= -->
+<!-- START: TO BE TRANSLATED -->
+<!ENTITY slimpac.advanced.language "Langue d'??l??ment">
+<!ENTITY slimpac.advanced.create_date "Record Creation Date">
+<!ENTITY slimpac.advanced.edit_date "Record Edit Date">
+<!-- END: TO BE TRANSLATED -->
Index: Open-ILS/web/opac/extras/slimpac/start.html
===================================================================
--- Open-ILS/web/opac/extras/slimpac/start.html (revision 7571)
+++ Open-ILS/web/opac/extras/slimpac/start.html (working copy)
@@ -1,6 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
+ <!--#include virtual="/opac/locale/${locale}/opac.dtd"-->
+]>
+
<html>
<head>
- <title>Simple Search</title>
+ <title>&slimpac.start.title;</title>
<style>
.maintable {
border-collapse: collapse;
@@ -61,7 +69,7 @@
<tr class="bluerow">
<td>
<div style='width: 100%; text-align: center'>
- <span>Now Searching: </span>
+ <span>&slimpac.search.nowSearching;</span>
<select name="searchOrg">
<!--#include file="lib_list.inc" -->
</select>
@@ -76,14 +84,14 @@
<input type="text" name="searchTerms" size="40"/>
<select name="searchClass">
- <option value="keyword">Keyword</option>
- <option value="title">Title</option>
- <option value="author">Author</option>
- <option value="subject">Subject</option>
- <option value="series">Series</option>
+ <option value="keyword">&common.keyword;</option>
+ <option value="title">&common.title;</option>
+ <option value="author">&common.author;</option>
+ <option value="subject">&common.subject;</option>
+ <option value="series">&common.series;</option>
</select>
- <input type="submit" value="Go!"/>
+ <input type="submit" value="&button.go;"/>
</div>
</td>
</tr>
@@ -98,41 +106,41 @@
<div style='width: 60%; text-align:center; padding: 10px; font-size: 8pt;'>
<span class='footer_link'>
- <a class='classic_link' href='/'>Dynamic Catalog</a>
+ <a class='classic_link' href='/'>&slimpac.start.dynamic;</a>
</span>
<span> | </span>
<span class='footer_link'>
- <a class='classic_link' href='advanced.html'>Advanced Search</a>
+ <a class='classic_link' href='advanced.html'>&opac.navigate.advanced;</a>
</span>
<span> | </span>
<span class='footer_link'>
- <a target='_blank' class='classic_link' href='http://www.georgialibraries.org/lib/directories/pineslibdir.html'>Find a Library Near Me</a>
+ <a target='_blank' class='classic_link' href='&footer.find.url;'>&footer.find.library;</a>
</span>
<span> | </span>
<span class='footer_link'>
- <a target='_blank' class='classic_link' href='http://open-ils.org/dokuwiki/doku.php?id=evergreen-user:opac_help'>Help</a>
+ <a target='_blank' class='classic_link' href='&footer.help.url;'>&footer.help;</a>
</span>
<span> | </span>
<span class='footer_link'>
- <a target='_blank' class='classic_link' href='http://www.georgialibraries.org/public/pines.html'>About PINES</a>
+ <a target='_blank' class='classic_link' href='&footer.library.url;'>&footer.library.about;</a>
</span>
<span> | </span>
<span class='footer_link'>
- <a target='' class='classic_link' id='eg_gal_link' href='http://www.galileo.usg.edu/'>GALILEO</a>
+ <a target='' class='classic_link' id='eg_gal_link' href='&footer.union.url;'>&footer.union;</a>
</span>
<br/>
<div style='margin-top: 4px; font-size: 7pt;'>
- <span>Copyright © 2006 Georgia Public Library Service</span>
+ <span>&footer.copyright;</span>
</div>
</div>
</center>
Index: Open-ILS/web/opac/extras/slimpac/advanced.html
===================================================================
--- Open-ILS/web/opac/extras/slimpac/advanced.html (revision 7571)
+++ Open-ILS/web/opac/extras/slimpac/advanced.html (working copy)
@@ -1,6 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE html PUBLIC
+ "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
+ <!--#include virtual="/opac/locale/${locale}/opac.dtd"-->
+]>
+
<html>
<head>
- <title>Advanced Search</title>
+ <title>&opac.navigate.advanced;</title>
<style>
.maintable {
border-collapse: collapse;
@@ -55,10 +63,10 @@
<table class="maintable">
<tbody>
- <tr><td colspan="2" align="center"><b>Advanced Search</b></td></tr>
+ <tr><td colspan="2" align="center"><b>&opac.navigate.advanced;</b></td></tr>
<tr class="rowpad"><td></td></tr>
<tr class="bluerow">
- <th>Now Searching:</th>
+ <th>&slimpac.start.nowSearching;</th>
<td>
<select name="searchOrg">
<!--#include file="lib_list.inc" -->
@@ -67,23 +75,23 @@
</tr>
<tr class="rowpad"><td></td></tr>
<tr class="greenrow">
- <th> Keywords: </th><td><input type="text" name="kw" size="40"/></td>
+ <th> &common.keywords.label; </th><td><input type="text" name="kw" size="40"/></td>
</tr>
<tr class="greenrow">
- <th> Title: </th><td><input type="text" name="ti" size="40"/></td>
+ <th> &common.title.label; </th><td><input type="text" name="ti" size="40"/></td>
</tr>
<tr class="greenrow">
- <th> Author: </th><td><input type="text" name="au" size="40"/></td>
+ <th> &common.author.label; </th><td><input type="text" name="au" size="40"/></td>
</tr>
<tr class="greenrow">
- <th> Subject: </th><td><input type="text" name="su" size="40"/></td>
+ <th> &common.subject.label; </th><td><input type="text" name="su" size="40"/></td>
</tr>
<tr class="greenrow">
- <th> Series: </th><td><input type="text" name="se" size="40"/></td>
+ <th> &common.series.label; </th><td><input type="text" name="se" size="40"/></td>
</tr>
<tr class="rowpad"><td></td></tr>
<tr class="bluerow">
- <th>Item Language</th>
+ <th>&advanced.language;</th>
<td>
<select name="searchLang">
<option value="">-- All --</option>
@@ -110,15 +118,15 @@
</td>
</tr>
<tr class="bluerow">
- <th>Sort by:</th>
+ <th>&advanced.sort.criteria;</th>
<td>
<select name="searchSort">
- <option value="">Relevance</option>
- <option value="title">Title</option>
- <option value="author">Author</option>
- <option value="pubdate">Publication Date</option>
- <option value="create_date">Record Creation Date</option>
- <option value="edit_date">Record Edit Date</option>
+ <option value="">&advanced.relevance;</option>
+ <option value="title">&common.title;</option>
+ <option value="author">&common.author;</option>
+ <option value="pubdate">&advanced.pubdate;</option>
+ <option value="create_date">&slimpac.advanced.create_date;</option>
+ <option value="edit_date">&slimpac.advanced.edit_date;</option>
</select>
</td>
</tr>
@@ -133,7 +141,7 @@
</td>
</tr>
-->
- <tr class="rowpad"><td align="center" colspan="2"><input type="submit" value="Go!"/></td></tr>
+ <tr class="rowpad"><td align="center" colspan="2"><input type="submit" value="&button.go;"/></td></tr>
</tbody>
</table>
@@ -144,35 +152,39 @@
<div style='width: 60%; text-align:center; padding: 10px; font-size: 8pt;'>
<span class='footer_link'>
- <a class='classic_link' href='start.html'>Home</a>
+ <a class='classic_link' href='/'>&slimpac.start.dynamic;</a>
</span>
+ <span class='footer_link'>
+ <a class='classic_link' href='start.html'>&slimpac.start.title;</a>
+ </span>
+
<span> | </span>
<span class='footer_link'>
- <a target='_blank' class='classic_link' href='http://www.georgialibraries.org/lib/directories/pineslibdir.html'>Find a Library Near Me</a>
+ <a target='_blank' class='classic_link' href='&footer.find.url;'>&footer.find.library;</a>
</span>
<span> | </span>
<span class='footer_link'>
- <a target='_blank' class='classic_link' href='http://open-ils.org/dokuwiki/doku.php?id=evergreen-user:opac_help'>Help</a>
+ <a target='_blank' class='classic_link' href='&footer.help.url;'>&footer.help;</a>
</span>
<span> | </span>
<span class='footer_link'>
- <a target='_blank' class='classic_link' href='http://www.georgialibraries.org/public/pines.html'>About PINES</a>
+ <a target='_blank' class='classic_link' href='&footer.library.url;'>&footer.library.about;</a>
</span>
<span> | </span>
<span class='footer_link'>
- <a target='' class='classic_link' id='eg_gal_link' href='http://www.galileo.usg.edu/'>GALILEO</a>
+ <a target='' class='classic_link' id='eg_gal_link' href='&footer.union.url;'>&footer.union;</a>
</span>
<br/>
<div style='margin-top: 4px; font-size: 7pt;'>
- <span>Copyright © 2006 Georgia Public Library Service</span>
+ <span>&footer.copyright;</span>
</div>
</div>
</center>
Index: Open-ILS/examples/apache/eg.conf
===================================================================
--- Open-ILS/examples/apache/eg.conf (revision 7571)
+++ Open-ILS/examples/apache/eg.conf (working copy)
@@ -45,8 +45,10 @@
# Remove the language portion from the URL
# ----------------------------------------------------------------------------------
AliasMatch ^/opac/.*/skin/(.*)/(.*)/(.*) /openils/var/web/opac/skin/$1/$2/$3
+AliasMatch ^/opac/.*/extras/slimpac/(.*) /openils/var/web/opac/extras/slimpac/$1
+
# ----------------------------------------------------------------------------------
# System config CGI scripts go here
# ----------------------------------------------------------------------------------
Index: Open-ILS/examples/apache/eg_vhost.conf
===================================================================
--- Open-ILS/examples/apache/eg_vhost.conf (revision 7571)
+++ Open-ILS/examples/apache/eg_vhost.conf (working copy)
@@ -9,7 +9,14 @@
# ----------------------------------------------------------------------------------
RedirectMatch 301 ^/$ /opac/en-US/skin/default/xml/index.xml
+# ----------------------------------------------------------------------------------
+# Assign a default locale to the accessible OPAC
+# ----------------------------------------------------------------------------------
+RedirectMatch 301 ^/opac/extras/slimpac/start.html$ /opac/en-US/extras/slimpac/start.html
+RedirectMatch 301 ^/opac/extras/slimpac/advanced.html$ /opac/en-US/extras/slimpac/advanced.html
+
+
# ----------------------------------------------------------------------------------
# Configure the gateway
# ----------------------------------------------------------------------------------
@@ -86,8 +93,8 @@
AddType application/xhtml+xml .xml
</LocationMatch>
-<LocationMatch /opac/extras/slimpac/>
- AddOutputFilter INCLUDES .html
+<LocationMatch /opac/.*/extras/slimpac/>
+ AddOutputFilter INCLUDES;XMLENT .html
</LocationMatch>
# ----------------------------------------------------------------------------------
More information about the Open-ils-dev
mailing list