EPrints Technical Mailing List Archive

Message: #04249


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Antwort: Multilingual site


Hi John,

I've followed your suggestion on installing the Spanish language pack from the Bazaar, both on my machine and on the demoprints site. On both systems I faced the same problems:

1) Spanish Home page (Inicio in the Spanish menu) returns a 404 error. This time, though, I see that even though (in my localsite) I've run bin/generate_static mysitename, archives/mysitename/html/es/index.* files have not been generated (which I suppose has to do with the Spanish translation not having translated it?).

2) Spanish flag and "eliminate cookies" image won't show on the menu bar, since eprints is looking for an images/flats/es.png file whereas the plugin creates a lang_ES.png file. I assume this problem can be easily resolved by copying lang_ES.png to the correct location with the correct filename?

Thanks again for the time and help,

George.

On 15/05/2015 06:35 μμ, John Salter wrote:

Hi,

I think that everything that is needed is in the Bazaar example I linked to – and possibly some of your steps have stopped things working!?

- new versions of EPrints already have a ‘set_lang’ script in cgi (I wonder if you’ve copied an older version over the top of this current version (see: https://github.com/eprints/eprints/blob/3.3/cgi/set_lang for the current one).

 

I’ve just enabled the Spanish language pack on http://demoprints.eprints.org/ (you can create an admin account on there, and install things :o).

The link to change languages appears without doing anything to the templates.

 

So maybe start by reverting your change to set_lang   and see how that helps.

 

Cheers,

John

 

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of George Mamalakis
Sent: 15 May 2015 14:26
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Antwort: Multilingual site

 

John Hi,

Yes I've included el in the specific variable. To make things easier for you, I'll repost what I've posted in stackoverflow:

"I have downloaded and unzipped the greek translation (for an earlier version, 3.0, from the official site) on the folders that seemed appropriate, I have placed the set_lang script in the cgi folder and changed the template to use it, I have changed languages.pl to include 'el' as well, I have re-generated statics and now the html folder contains my Greek index.html, I have restarted apache"

Thank you for prompting me on the Spanish Language Pack, I'll see what changes I'll have to still make in order to complete the Greek translation. But before that, I hope I'll manage to see the translated site :).

As far as the plugin is concerned: apart from copying the set_lang script on the cgi folder and adding appropriate content in the template to use it (by calling cgi/set_lang?langid=el) is there something else that needs to be done?

Otherwise: as far as the core system is concerned. How does it know that it is "ready" to start servicing a multilingual site? Is it enough to add an additional language in $c->{languages} (of ~/archives/ARCHIVEID/cfg/cfg.d/languages.pl) and copy the translation file in the cfg/lang/XX folder? Or does it need something additional that I am missing?

Thanks again for your time and help!

On 15/05/2015 03:51 μμ, John Salter wrote:

Hi George,

Have you added anything to ~/archives/ARCHIVEID/cfg/cfg.d/languages.pl?

By default it’s something like:

$c->{defaultlanguage} = 'en';

$c->{languages} = [ 'en' ];

 

You should add the new language in  the second option e.g.:

$c->{languages} = [ 'en', 'el' ];

 

The newer way of doing things is shown in this EPrints Bazaar package (unfortunately for Spanish, not Greek): http://bazaar.eprints.org/227/ . In the file x_lang_es.pl, it achieves the same thing with:

push @{$c->{languages}},'es';

 

I’d take this Bazaar package as a base for how to do things – e.g. which files would need to be translated.

Many of the phrases would exist in the 3.0 translation you’ve installed – but some won’t.

 

Let me know if that gets you any further down the path – and we can go from there!

 

Cheers,

John

 

PS I don’t have any real experience of working with multi-lingual repositories – but have tried to learn bits!

 

 

From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of George Mamalakis
Sent: 15 May 2015 13:13
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Antwort: Multilingual site

 

Martin, hi and thanks for your answer!

I have generated static, the html folder of my deposit has been populated with the correct html files (I've looked into their content), and when I select the Greek language through an href (on an image), as I said, it displays the "language has changed" page in Greek, but when I click on any link (menu, whatever) the content served is in English.

I have used Chrome, Firefox and Opera and it won't work in any of them.

I have to re-inform you that I installed the Greek translation (which is for a previous version of eprints, 3.0) without using any guide, which means that I just copied the folders contained in the zip file where it seemed appropriate (./lib/defaultcfg and ./lib/lang in the eprints folder, and cfg/lang/el in the specific archive). As I read in eprints' documentation regarding previous versions (<3), a few stuff needed to be done in order to install translations, that didn't seem "compatible" with my version. Maybe I am missing something here...

If not, then I am not sure what part of eprints' core functionality fails and doesn't load the language correctly or if the problem is related to the set_lang script.

Thanks again for your answer!

PS. I wasn't sure about the activity of this list, so a few hours ago (before receiving your answer) I started an analogous question in stackoverflow: http://stackoverflow.com/questions/30254057/eprints-multilingual-site

On 15/05/2015 11:03 πμ, martin.braendle@id.uzh.ch wrote:

Hi,

two questions come to my mind:

- did you run bin/generate_static  your_repo --prune    ?
- which browser did you use to test? Safari sends a slightly different Accept-Language token in the HTTP header, which is not properly recognized by Repository.pm.

A possible patch is:

Modified: trunk/src/core/perl_lib/EPrints/Repository.pm
===================================================================
--- trunk/src/core/perl_lib/EPrints/Repository.pm 2014-08-12 12:23:41 UTC (rev 857)
+++ trunk/src/core/perl_lib/EPrints/Repository.pm 2014-09-10 13:00:28 UTC (rev 858)
@@ -2264,6 +2264,8 @@
foreach my $browser_lang ( split( /, */, $accept_language ) )
{
$browser_lang =~ s/;.*$//;
+ # UZH CHANGE ZORA-274 fix for Safari browser 2014/08/15/mb
+ $browser_lang =~ s/-.*$//;
push @prefs, $browser_lang;
}
}



Best regards,

Martin
 
--
Dr. Martin Brändle
Zentrale Informatik
Universität Zürich
Winterthurerstr. 190
CH-8057 Zürich





-- 
George Mamalakis
 
IT and Security Officer, 
Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki),
PhD (Aristotle Univ. of Thessaloniki),
MSc (Imperial College of London)
 
School of Electrical and Computer Engineering
Aristotle University of Thessaloniki
 
phone number : +30 (2310) 994379
 
 




*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/




-- 
George Mamalakis
 
IT and Security Officer, 
Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki),
PhD (Aristotle Univ. of Thessaloniki),
MSc (Imperial College of London)
 
School of Electrical and Computer Engineering
Aristotle University of Thessaloniki
 
phone number : +30 (2310) 994379
 
 


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/


-- 
George Mamalakis

IT and Security Officer, 
Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki),
PhD (Aristotle Univ. of Thessaloniki),
MSc (Imperial College of London)

School of Electrical and Computer Engineering
Aristotle University of Thessaloniki

phone number : +30 (2310) 994379