Installation of additional languages for OPAC and INTRANET staff client

From Koha Wiki

Jump to: navigation, search
Home > Documentation
Home > Documentation > Installation
Translation

Contents

Introduction

You have to distinguish between the user interface for library users (OPAC) and for librarians (Intranet) and texts stored in the database. In Koha 3.2 the database text translations can be activated from the web installer of koha. The user interface translations can be translated at any time following the instructions given here:

Getting the latest translation files

Translations of Koha into a number of languages other than american english is an ongoing process every day on the Koha Pootle project web page. For many languages the stable Koha installation packages come with outdated or disfunctional translation files. Thus it is a good idea to download the latest translation files for languages you want to enrich your koha installation with, from the Koha Pootle web page, before you start to do the following:

Koha 3.2 and newer versions

Additional languages for the OPAC and INTRANET user interfaces can be added any time to a running koha installation from the directory

 ../../misc/translator

with the command:

 $ perl translate install <language-code>

Example:

 $ perl tranlate install fr-FR

Note: You might have to specify the location of koha perl modules and of the koha-conf file, e.g.:

 $ sudo env KOHA_CONF=/etc/koha/sites/koha/koha-conf.xml PERL5LIB=/usr/share/koha/lib/ perl translate install fr-FR

Check the pathes on your own installation. To find them, for eg. you could run "updatedb" (might take a while) and then "locate koha-conf.xml".

Warning! If you're doing a new installation and you don't see the language in which you want to use Koha in the web installer, you MUST run the above script prior to continuing the web installation

After installing a new language it has to be activated in the system preference editor:

 > Home › Administration › System Preferences > OPAC > I18N/L10N

Koha 3.00.06

Multilanguage Packages

From the Download Page of Koha there are multilanguage installation packages available with language support for all available languages. The server performance might be notably reduced if you are using them. On a productive system add only needed additional languages.

Adding additional languages before installing Koha on your server

You can add additional languages before you start to install koha (before you run the Makefile.po script) to get also on the web installer a choice of additional languages.

After unpacking koha-3.00.06.tar.gz (or a later version) cd into the directory ../../misc/translator which might be something like:

  $ cd koha-3.00.06/misc/translator/

Don't use the install.pl script. This would install all available languages. Use the install-code-pl and select the languages only you wish to have. For adding the additional languages French and Spanish the command would be:

  $ perl install-code.pl fr-FR es-ES

To get the correct abbrevations of languages check the folder ../../misc/translator/po

Adding additional languages after installing Koha on your server

Adding language support for french to the OPAC of your koha installation:

 $ cd /usr/share/koha/misc/translator
 $ sudo ./tmpl_process3.pl install \
   -i /usr/share/koha/opac/htdocs/opac-tmpl/prog/en/ \
   -o /usr/share/koha/opac/htdocs/opac-tmpl/prog/fr-FR/ \
   -s /home/koha/fr-FR-i-opac-t-prog-v-3000000.po \
   -r

Note: In this example the fr-FR-i-opac-t-prog-v-3000000.po file was downloaded from translate.koha.org (->Review ->right-click "Download") and placed in the home folder of the user "koha".

Getting additional information about this script:

 $ ./tmpl_process3.pl --help 

Activate the previously installed language files from the Intranet web page:

 > Home › Administration › System Preferences > OPAC > I18N/L10N

Removing a Language that was Accidentally Installed

If a non-existing language, e.g. de-XY, is installed, the perl translate script will error out. The language directories, however, will already have been created under koha/opac/htdocs/opac-tmpl/prog and koha/intranet/htdocs/intranet-tmpl/prog and the language is presented as a choice in the admin interface.

Simply removing the aforementioned directories will also remove the language code in the admin interface.