How to translate eprints 2

From EPrints Documentation
Jump to: navigation, search


Warning This page contains out of date information and may no longer work or be superseded by a better technique.

Please note! This page was written for EPrints version 2 and may not apply to version 3.


This is a guide to translating the default eprints2 distribution into a new language. Eprints 3 uses different method, and different directory structure.

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