Difference between revisions of "How to translate eprints"

From EPrints Documentation
Jump to: navigation, search
 
Line 1: Line 1:
Step by step guide to getting EPrints 2.3.13.1 installed on Fedora Core 4.
+
This is a guide to translating the default eprints distribution into a new language.
  
Please add bugs and comments at the end of this page.
 
  
!!Install Fedora Core 4
+
!!!NOTE: If you want to install a language package that uses acents and others special characters, you will need GDOME system. See http://wiki.eprints.org/w/EPrints2/LanguageFAQ.
  
At the ''Installation Type'' step [[http://fedora.redhat.com/docs/fedora-install-guide-en/fc4/ch-installtypes.html]], choose ''Workstation''.
 
  
At the ''Security Configuration'' step [[http://fedora.redhat.com/docs/fedora-install-guide-en/fc4/ch-security-config.html]], tick ''Remote Login'' and ''Web server'' and disable SELinux (or set it to ''warn'').
+
First of all check the ListOfTranslations already available!
  
At the ''Package Installation Defaults'' step [[http://fedora.redhat.com/docs/fedora-install-guide-en/fc4/ch-packageselection.html]], select ''Customize software packages to be installed'' and add ''Web Server'' and ''MySQL database'' to the list.
+
You don't replace the english files. All language-speciific files have 'en' in the title. They should be copied and 'en' replaced with the ISO language code of the translation.
  
!!Install Required Packages
+
All language-specific files are XML to easy translation.
  
If this is the first time yum has been run, import the GPG-KEYs for the Fedora RPM repositories:
+
XML attributes, eg. &archivename; should ''not'' be translated.
  
@@root> rpm --import /usr/share/doc/fedora-release-4/*GPG-KEY*@@
+
The software was designed with the idea of translation in mind, which should make the task easier.
  
If your eprints server connects to the Web via a proxy, set the http_proxy environment variable:
+
The translation for 2.3.3 should work with 2.3.anything, althogh the next minor version 2.4 may introduce new/changed phrases.
  
@@root> export http_proxy=http://proxy.yourdomain.com:port/ @@
+
eprints-2.3.4/cfg/system-phrases-XX.xml
 +
* This is the main phrases file. It describes all the phrases the software uses, except ones specific to a local configuration.
  
Use yum to install the Gnome DOM libraries:
+
eprints-2.3.4/defaultcfg/phrases-XX.xml
 +
* This file describes configuration-specific phrases for a default archive. Such as the name of the fields.
  
@@root> yum install gdome2 gdome2-devel@@
+
eprints-2.3.4/defaultcfg/citations-XX.xml
 +
* Describes the way eprints, users and subjects are described.
  
.. the wvware Word document libraries:
+
eprints-2.3.4/defaultcfg/template-XX.xml
 +
* This is the default template (headers and footers) for an archive
  
@@root> yum install wv@@
+
eprints-2.3.4/defaultcfg/static/XX/
 +
* This directory contains a number of files, which are the default static webpages (in English) for an archive. A /fr/ (or whatever language) directory should be added.
  
.. and xpdf:
+
The subject tree should be translated, you will then need to use an XML-encoded subject file. The english version is provided here:
 +
Attach:subjects.xml
  
@@root> yum install xpdf@@
+
To make the translation add a new <lang> element to each record with the translated name.
  
wvText (from wv) and pdftotext (from xpdf) are used by the EPrints for full text indexing.
+
<record>
 +
  <field name="subjectid">CC</field>
 +
  <field name="name">
 +
      <lang id="en">CC Archeology</lang>
 +
      <lang id="fr">CC Arch&#233;ologie</lang>
 +
  </field>
 +
  <field name="parents">C</field>
 +
  <field name="depositable">TRUE</field>
 +
</record>
  
!!Install Required Perl Modules
+
The modified file have to be imported into the database using the '''bin/import_subjects''' script with the --xml flag set.
  
The majority of perl modules need by EPrints are already installed.
+
eprints@local:/opt/eprints2> bin/import_subjects YYY -xml subject.xml
  
Install Unicode::String using yum:
+
!!!How to install/configure the Translation Package
  
@@root> yum install perl-Unicode-String@@
+
# Untar the package in root directory (/): ''eprints@local:/> tar xvzf eprints-2.3.4-translation-XX.tgz ''
  
Install XML::GDOME from source:
+
# Edit the '''opt/eprints2/defaultcfg/phrases-XX.xml''' file and replace ''&6acute'' to ''&acute''
  
@@root> wget http://cpan.uwinnipeg.ca/cpan/authors/id/T/TJ/TJMATHER/XML-GDOME-0.86.tar.gz @@
+
# Modify the XML config archive and set into the label the ISO language (3 labels): <language>, <defaultlanguage> y <archivename language="XX">
  
@@root> tar xzvf XML-GDOME-0.86.tar.gz@@
+
# re-execute all Perl Script
  
@@root> cd XML-GDOME-0.86/@@
+
% bin/generate_apacheconf
 
+
% bin/create_tables ARCHIVEID
@@root> perl Makefile.PL@@
+
% bin/import_subjects ARCHIVEID -xml subjects.xml
 
+
% bin/generate_static ARCHIVEID
@@root> make@@
+
% bin/create_user ARCHIVEID USERID EMAIL admin PASSWORD
 
+
% bin/generate_views ARCHIVEID
@@root> make install@@
+
 
+
!!Add an "eprints" user and group
+
 
+
@@root> useradd eprints@@
+
 
+
!!Set up services
+
 
+
Make apache and mysql start automatically when the machine is rebooted:
+
 
+
@@root> /sbin/chkconfig mysqld on@@
+
 
+
@@root> /sbin/chkconfig httpd on@@
+
 
+
!!Install EPrints
+
 
+
@@root> wget http://www.eprints.org/files/eprints2/eprints-2.3.13.1.tar.gz @@
+
 
+
@@root> tar xzvf eprints-2.3.13.1.tar.gz@@
+
 
+
@@root> cd eprints-2.3.13.1/@@
+
 
+
Find out the name of your outgoing SMTP (email) server.
+
 
+
@@root> ./configure --with-smtp-server smtp.yourdomain@@
+
 
+
@@root> ./install.pl@@
+
 
+
!!Set up apache
+
 
+
Edit the apache config:
+
 
+
@@root> vi /etc/httpd/conf/httpd.conf@@
+
 
+
Find the lines:
+
 
+
@@User apache@@
+
 
+
@@Group apache@@
+
 
+
and change them to:
+
 
+
@@User eprints@@
+
 
+
@@Group eprints@@
+
 
+
Add this line to the end of httpd.conf:
+
 
+
@@Include /opt/eprints2/cfg/apache.conf@@
+
 
+
!!Set up the indexer as a service
+
 
+
@@root> ln -s /opt/eprints2/bin/epindexer /etc/init.d/epindexer@@
+
 
+
@@root> chkconfig --add epindexer@@
+
 
+
Make the indexer start automatically when the machine is rebooted:
+
 
+
@@root> chkconfig epindexer on@@
+
 
+
!!Configure an archive
+
 
+
Start mysql:
+
 
+
@@root> service mysqld start@@
+
 
+
Follow the steps in the main EPrints documentation [[http://www.eprints.org/documentation/tech/php/installation.php#creating_an_archive]] to configure an archive.
+

Revision as of 15:09, 2 March 2006

This is a guide to translating the default eprints distribution into a new language.


!!!NOTE: If you want to install a language package that uses acents and others special characters, you will need GDOME system. See http://wiki.eprints.org/w/EPrints2/LanguageFAQ.


First of all check the ListOfTranslations already available!

You don't replace the english files. All language-speciific files have 'en' in the title. They should be copied and 'en' replaced with the ISO language code of the translation.

All language-specific files are XML to easy translation.

XML attributes, eg. &archivename; should not be translated.

The software was designed with the idea of translation in mind, which should make the task easier.

The translation for 2.3.3 should work with 2.3.anything, althogh the next minor version 2.4 may introduce new/changed phrases.

eprints-2.3.4/cfg/system-phrases-XX.xml
  • This is the main phrases file. It describes all the phrases the software uses, except ones specific to a local configuration.
eprints-2.3.4/defaultcfg/phrases-XX.xml
  • This file describes configuration-specific phrases for a default archive. Such as the name of the fields.
eprints-2.3.4/defaultcfg/citations-XX.xml
  • Describes the way eprints, users and subjects are described.
eprints-2.3.4/defaultcfg/template-XX.xml
  • This is the default template (headers and footers) for an archive
eprints-2.3.4/defaultcfg/static/XX/
  • This directory contains a number of files, which are the default static webpages (in English) for an archive. A /fr/ (or whatever language) directory should be added.

The subject tree should be translated, you will then need to use an XML-encoded subject file. The english version is provided here: Attach:subjects.xml

To make the translation add a new <lang> element to each record with the translated name.

<record>
  <field name="subjectid">CC</field>
  <field name="name">
     <lang id="en">CC Archeology</lang>
     <lang id="fr">CC Archéologie</lang>
  </field>
  <field name="parents">C</field>
  <field name="depositable">TRUE</field>
</record>

The modified file have to be imported into the database using the bin/import_subjects script with the --xml flag set.

eprints@local:/opt/eprints2> bin/import_subjects YYY -xml subject.xml

!!!How to install/configure the Translation Package

  1. Untar the package in root directory (/): eprints@local:/> tar xvzf eprints-2.3.4-translation-XX.tgz
  1. Edit the opt/eprints2/defaultcfg/phrases-XX.xml file and replace &6acute to &acute
  1. Modify the XML config archive and set into the label the ISO language (3 labels): <language>, <defaultlanguage> y <archivename language="XX">
  1. re-execute all Perl Script
% bin/generate_apacheconf
% bin/create_tables ARCHIVEID
% bin/import_subjects ARCHIVEID -xml subjects.xml
% bin/generate_static ARCHIVEID
% bin/create_user ARCHIVEID USERID EMAIL admin PASSWORD
% bin/generate_views ARCHIVEID