[greenstone-users] Changing language

From Michael Dewsnip
DateThu May 8 14:25:01 2008
Subject [greenstone-users] Changing language
In-Reply-To (d2dbf2f40805070709n35d73f8ak79c562c07aa5d7bd-mail-gmail-com)
Hi Ra□l,

This is actually a lot harder than it should be, unfortunately.

You need to start by editing the macros/extra.dm file for your
collection and customising the

macro to add the two links
at the top of every page:

package Style

{
<!-- page banner (_style:pagebanner_) -->
<div id="banner">
<div class="pageinfo">
<p class="bannerlinks">HOME HELP PREFERENCES</p>

</div>
<div class="collectimage">Greenstone Archives collection</div>
</div>
<div class="bannerextra"></div>
<!-- end of page banner -->

<div style="float: right"><a href="...">English</a> | <a
href="...">Spanish</a></div><div style="clear: both"></div>
}

Now, what do you use for the links (the "..." bits)? All you need to do
is add "l=en" or "l=es" to the end of the current URL to change the
language, but Greenstone makes this difficult. The problem is that there
is no Greenstone macro (that I know of, anyway) that is set to the
current URL. So you can't just do something like

<a href="_currenturl_&l=es">Spanish</a>

The other problem with this would be that if people clicked back and
forth between the two links the URLs would continue to get longer and
longer. (You may not care about this, as it doesn't affect the
functionality.)

When we were developing the PapersPast site, we got around these two
problems by customising the C++ code to set a macro to the current page
URL, but without the "l" argument, and used this. If you have experience
with C++ and compiling Greenstone then this might be an option for you.
However, I think a better option is probably to write a small Javascript
function that edits the "location.href" variable to add the "l=es" or
"l=en" bits when the links are clicked. This wasn't an option for
PapersPast because the site had to remain functional with Javascript
disabled.

Regards,

Michael

--
DL Consulting Ltd
Greenstone Digital Library, Web Development, Hosting and Digitisation Specialists
www.dlconsulting.com


Ra□l Barrera wrote:
> Hello List.
> I need help to make a Library in two languages English and Spanish.
> How can I make buttons to change between languages anywhere in the
> site? as in this Greenstone installation:
> http://paperspast.natlib.govt.nz/cgi-bin/paperspast
> Any help is welcome.
>
> Thanks and regards
>
> --
> Ra□l Barrera P.
> Director Tecnolog□a y Desarrollo
> Prodigio Consultores
> Fono: 236 86 80
> Celular: 9-617 47 06
> ------------------------------------------------------------------------
>
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://list.scms.waikato.ac.nz/mailman/private/greenstone-users/attachments/20080508/71280b2b/attachment.html