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

Koha's texts are stored in two different places

  • templates
  • database

This page deals with templates translations. They are used to draw the user interfaces for library users (OPAC) and for librarians (Intranet). They can also be translated to new languages at any time.

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. Every monthly stable release ships the latest translation files.

IMPORTANT: Note that if you want sample data and frameworks (which are both stored on the database) translated to your favourite language (instead of the default american english), you MUST follow this translation steps BEFORE you launch the webinstaller, so it can be run in your desired language.

Packages (3.12 and newer versions)

Starting with version 3.12.0, the Koha packages provide a convenient helper script that handles the install process of translations: koha-translate.

To get a list of the installed languages run:

$ koha-translate --list

To get a list of the available languages run:

$ koha-translate --list --available

To install a new language run:

$ koha-translate --install <language-code>

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

 > Home › Administration › System Preferences > I18N/L10N

For further options run:

$ koha-translate --help

Packages (pre-3.12 versions)

If you have older packages install, you can add additional languages for the OPAC and INTRANET user interfaces at any time to a running koha installation from the directory

 /usr/share/koha/misc/translator

First you have to specify the location of koha perl modules and of the koha-conf-site.xml.in file:

 $ export KOHA_CONF=/etc/koha/koha-conf-site.xml.in
 $ export PERL5LIB=/usr/share/koha/lib/

Then install the desired language with the command:

 $ cd /usr/share/koha/misc/translator
 $ sudo perl translate install <language-code>

Example:

 $ sudo perl translate install fr-FR

Tarball/Git (3.2 and newer versions)

If you have a tarball or git install, you can add additional languages for the OPAC and INTRANET user interfaces at any time to a running koha installation from the directory

 <koha_install_dir>/misc/translator

First you have to specify the location of koha perl modules and of the koha-conf.xml file, e.g.:

 $ export KOHA_CONF=<path_to>/koha-conf.xml
 $ export PERL5LIB=<koha_install_dir>/lib/

Then install the desired language with the command:

 $ cd <koha_install_dir>/misc/translator
 $ sudo perl translate install <language-code>

Example:

 $ sudo perl translate install fr-FR

Check the pathes on your own installation. To find them, for e.g. you could run:

 $ sudo updatedb

(might take a while) and then:

 $ locate koha-conf.xml

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

 > Home › Administration › System Preferences > 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, might have already been created under:

 <koha_install_dir>/opac/htdocs/opac-tmpl/prog
 <koha_install_dir>/opac/htdocs/opac-tmpl/ccsr
 <koha_install_dir>/intranet/htdocs/intranet-tmpl/prog

and the language is presented as a choice in the admin interface.

If you are on a (3.12 or newer) packages install, you can just run:

 $ koha-translate --remove <language-code>

On other setups, simply removing the aforementioned directories will also remove the language code in the admin interface.

Broken PO files: getting the latest translation files

Sometimes 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. You should put the relevant PO files you downloaded in the translator/po directory.

Unsupported versions (Koha 3.00.06)

This are the install instructions for unsupported older versions. Are left just in case.

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 http://translate.koha-community.org ( Clicked French, Chose the version, Downloaded the OPAC translation file) 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 > I18N/L10N

See Also

Correcting Search of Arabic records

Personal tools