<chapter id="translation">
<title>Language translations</title>
<para>
The OTRS webfrontend supports different frontend languages. The language translation files are located under Kernel/Language/*.pm. 
</para>
<para>
Beginning with release 1.3, translations are multi-layered. 
</para>
<orderedlist>

<listitem><para>
Kernel/Language/$Locale.pm - default, this file is read first.
</para></listitem>

<listitem><para>
Kernel/Language/$Locale_$Action.pm - translations for add-on modules like Calender. Overrides the precedent.
</para></listitem>

<listitem><para>
Kernel/Language/$Locale_Custom.pm - your own translations/additions. You may override any definition of the previous files.
</para></listitem>

</orderedlist>


<sect1 id="translation-example">
<title>New translation files</title>
<para>
If you want to translate OTRS into a new language, you have to follow these five steps:
</para>

<itemizedlist mark='opencircle'>

<listitem><para>
Take the current German translation (Kernel/Language/de.pm) from CVS (http://cvs.otrs.org/).
</para></listitem>

<listitem><para>
Change the package name (z. g. "package Kernel::Language::de;" to "package Kernel::Language::fr;") and translate each word/sentence.
</para></listitem>

<listitem><para>
Add the new language translation to the system via adding "$Self->{DefaultUsedLanguages}->{fr} = 'French';" to your Kernel/Config.pm. 
</para></listitem>

<listitem><para>
If you use mod_perl, restart your webserver and you will have the new language.
</para></listitem>

<listitem><para>
Send the new translation file to feedback at otrs.org - Thanks!
</para></listitem>

</itemizedlist>

<para>
Now you can select the new language in your preferences screen.
</para>

<example>
<title>Kernel/Language/de.pm - Old file</title>
<programlisting>
# --
# Kernel/Language/de.pm - provides de language translation
# Copyright (C) 2002-2003 Martin Edenhofer xxxxxxxxxxxxxxxxxxxx
# --
# $Id: language-translation.sgml,v 1.3 2004/09/21 20:48:02 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --
package Kernel::Language::de;

use strict;

use vars qw($VERSION);
$VERSION = '$Revision: 1.3 $';
$VERSION =~ s/^.*:\s(\d+\.\d+)\s.*\$/$1/;

# --
sub Data {
    my $Self = shift;
    my %Param = @_;
    my %Hash = ();

    # $$START$$
    # Last translation Fri Jan  3 20:39:15 2003 by 

    # possible charsets
    $Self->{Charset} = ['iso-8859-1', 'iso-8859-15', ];
    # date formats (%A=WeekDay;%B=LongMonth;%T=Time;%D=Day;%M=Month;%Y=Jear;)
    $Self->{DateFormat} = '%D.%M.%Y %T';
    $Self->{DateFormatLong} = '%A %D %B %T %Y';
    $Self->{DateInputFormat} = '%D.%M.%Y - %T';

    %Hash = (
    # Template: AAABase
      ' 2 minutes' => ' 2 Minuten',
      ' 5 minutes' => ' 5 Minuten',
      ' 7 minutes' => ' 7 Minuten',
      '10 minutes' => '10 Minuten',
      '15 minutes' => '15 Minuten',
      'AddLink' => 'Link hinzufügen',
      'AdminArea' => 'AdminBereich',
      'all' => 'alle',
      'All' => 'Alle',
      'Attention' => 'Achtung',
[...]
</programlisting>
</example>

<para>
To:
</para>

<example>
<title>Kernel/Language/fr.pm - New file</title>
<programlisting>
# --
# Kernel/Language/fr.pm - provides fr language translation
# Copyright (C) 2002 Bernard Choppy xxxxxxxxxxxxxxxxxxxx
# Copyright (C) 2002-2003 Nicolas Goralski xxxxxxxxxxxxxxxxxxxx
# --
# $Id: language-translation.sgml,v 1.3 2004/09/21 20:48:02 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
# --
package Kernel::Language::fr;

use strict;

use vars qw($VERSION);
$VERSION = '$Revision: 1.3 $';
$VERSION =~ s/^.*:\s(\d+\.\d+)\s.*\$/$1/;
# --
sub Data {
    my $Self = shift;
    my %Param = @_;
    my %Hash = ();

    # $$START$$
    # Last translation Fri Jan  3 20:40:04 2003 by 

    # possible charsets
    $Self->{Charset} = ['iso-8859-1', 'iso-8859-15', ];
    # date formats (%A=WeekDay;%B=LongMonth;%T=Time;%D=Day;%M=Month;%Y=Jear;)
    $Self->{DateFormat} = '%D.%M.%Y %T';
    $Self->{DateFormatLong} = '%A %D %B %T %Y';
    $Self->{DateInputFormat} = '%D.%M.%Y - %T';

    %Hash = (
    # Template: AAABase
      ' 2 minutes' => ' 2 minutes',
      ' 5 minutes' => ' 5 minutes',
      ' 7 minutes' => ' 7 minutes',
      '10 minutes' => '10 minutes',
      '15 minutes' => '15 minutes',
      'AddLink' => 'Ajouter un lien',
      'AdminArea' => 'Zone d\'administration',
      'all' => 'tout',
      'All' => 'Tout',
      'Attention' => 'Attention',
[...]
</programlisting>
</example>
</sect1>

<sect1 id="translation-Actions">
<title>Translation for Actions</title>
<para>
The Actions file may override the default values coming from Kernel/Language/$Locale.pm, though it is meant to contain translations for a specific module and is therefore in use only when the module is loaded.
</para>

<example>
<title>Kernel/Language/de_Calendar.pm</title>
<programlisting>
# --
package Kernel::Language::de_Calendar;
# --
use strict;

use vars qw($VERSION);
$VERSION = '$Revision: 1.3 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;

# --
sub Data {
    my $Self = shift;
    my %Param = @_;

    # $$START$$

    $Self->{Translation}->{'Calendar'} = 'Termine';

    # $$STOP$$
}
# --
1;
</programlisting>
</example>

</sect1>

<sect1 id="translation-custom">
<title>Customizing Translations</title>
<para>
This file is read at last, so you may override any of the settings coming from the previous files. You may also add your own, new translations as well.
</para>

<example>
<title>Kernel/Language/de_Custom.pm</title>
<programlisting>
# --
package Kernel::Language::de_Custom;
# --
use strict;

use vars qw($VERSION);
$VERSION = '$Revision: 1.3 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;

# --
sub Data {
    my $Self = shift;
    my %Param = @_;

    # $$START$$

    # Re-Definitions
    $Self->{Translation}->{'Lock'} = 'Bearbeiten';
    $Self->{Translation}->{'Unlock'} = 'Freigeben';

    # Additions
    $Self->{Translation}->{'Model#'} = 'Modell-Nr.';
    $Self->{Translation}->{'spare part number'} = 'Ersatzteil-Nummer';

    # $$STOP$$
}
# --
1;
</programlisting>
</example>

</sect1>

</chapter>
