Difference between revisions of "How to translate eprints 2"

From EPrints Documentation
Jump to: navigation, search
Line 1: Line 1:

Latest revision as of 10:37, 9 December 2011

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.

  • This is the main phrases file. It describes all the phrases the software uses, except ones specific to a local configuration.
  • This file describes configuration-specific phrases for a default archive. Such as the name of the fields.
  • Describes the way eprints, users and subjects are described.
  • This is the default template (headers and footers) for an archive
  • 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.

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

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/generate_views ARCHIVEID