[EP-tech] Re: Antwort: Multilingual site

John Salter J.Salter at leeds.ac.uk
Fri May 15 13:51:55 BST 2015


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 at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of George Mamalakis
Sent: 15 May 2015 13:13
To: eprints-tech at 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 at id.uzh.ch<mailto:martin.braendle at 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




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20150515/d688c1ac/attachment-0001.html 


More information about the Eprints-tech mailing list