[greenstone-users] Change language usin macro currenturl

From qq6@cs.waikato.ac.nz
DateFri May 30 11:41:15 2008
Subject [greenstone-users] Change language usin macro currenturl
In-Reply-To (d2dbf2f40805291353w513a5f76x810eeaf11f9dbef8-mail-gmail-com)
Hi Ra□l

Michael has given a clear solution to this issue. I forward it to you.


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 class="collectimage">Greenstone Archives collection</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

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



DL Consulting Ltd
Greenstone Digital Library, Web Development, Hosting and Digitisation

> Hi List, I have the following problem, I need to change between 2
> languages,
> and I test usin the macro _currenturl_ and it's just what I need, but for
> a
> problem with my pc I lost all configurations and I don't remember how to
> use
> it.
> Please I need to know the way tu apply this macro to an url to change
> between languages.
> Thank you and regards.
> --
> Ra□l Barrera P.
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users