\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
\part{Translating Horde Applications}
\textbf{This information is valid for Horde 3 only. See <a href="https://wiki.horde.org/Doc/Dev/Translation">Doc/Dev/Translation</a> for Horde 4 and later.}

by <a href="https://wiki.horde.org/mailto:vijay.mahrra@es.easynet.net">vijay.mahrra@es.easynet.net</a>


\noindent\rule{\textwidth}{1pt}
This document is intended to help developers translate a Horde 3 module using the new \textbf{translation.php} script.

Please feel free to fill in any gaps or clarify any existing information presented here.

Read also \texttt{horde/po/README}.


\noindent\rule{\textwidth}{1pt}
\section{Document Standards}
The following standards and assumptions are used throughout this document.  Please adjust accordingly to your situation.

\begin{itemize}
\item You have a working Horde Framework 3 installation.


\item You have at least one module configured and working gettext'ed \_("") English for all strings that require translation.


\end{itemize}

\noindent\rule{\textwidth}{1pt}
\part{The Translation Script}
<pre><code>
\$ php horde/po/translation.php

Usage: translation.php [options] command [command-options]
       translation.php [help|-h|--help] [command]

Helper application to create and maintain translations for the Horde
framework and its applications.
For an introduction read the file README in this directory.

Commands:
  help        Show this help message.
  compendium  Rebuild the compendium file. Warning: This overwrites the
              current compendium.
  extract     Generate PO template (.pot) files.
  init        Create one or more PO files for a new locale. Warning: This
              overwrites the existing PO files of this locale.
  merge       Merge the current PO file with the current PO template file.
  update      Run extract and merge sequent.
  update-help Extract all new and changed entries from the English XML help
              file and merge them with the existing ones.
  cleanup     Cleans the PO files up from untranslated and obsolete entries.
  make        Build binary MO files from the specified PO files.
  make-help   Mark all entries in the XML help file being up-to-date and
              prepare the file for the next execution of update-help. You
              should only run make-help AFTER update-help and revising the
              help file.
  commit      Commit translations to the CVS server.
  commit-help Commit help files to the CVS server.

Options:
  -b, --base=/PATH  Full path to the (Horde) base directory that should be
                    used.
  -d, --debug       Show error messages from the executed binaries.
  -h, --help        Show this help message.
  -t, --test        Show the executed commands but don't run anything.

Please report any bugs to i18n@lists.horde.org.
</code></pre>
These commands can be called with \texttt{translation.php COMMAND help} for further information.

\subsection{Making a Translation}
\section{Intialise/Merge the Translation}
If this is the first time, run:<br />
\texttt{php translation.php init --module=MODULE --locale=xx\_XX} where MODULE is the module folder under horde and xx\_XX is the locale (country and language code), e.g. en\_GB or es\_ES

then, if you didn't create one before, build the compendium with all existing translations for the locale from other Horde applications:<br />
\texttt{php translation.php compendium --locale=xx\_XX}

finally, try to get as many translations as possible from the compendium into the new translation:<br />
\texttt{php translation.php merge --module=MODULE --locale=xx\_XX}

\section{Edit and Update the Translation}
Create the compendium file (do this one time only):

\texttt{php translation.php compendium --locale=xx\_XX}

Clean up obsolte entries:

\texttt{php translation.php cleanup}

Prepare the file to edit:

\texttt{php translation.php update --module=MODULE --locale=xx\_XX}

Edit the translation file \textit{horde/MODULE/po/xx\_XX} using a suitable gettext editing program, such as KBabel or poedit and save the file.

Compile the translation:

\texttt{php translation.php make}

If you want to see the changes right away, restart the http server (i.e. \textit{service httpd restart} in Fedora, <a href="https://wiki.horde.org/CentOS">CentOS</a> and similar OSes).

If you are *not* getting framework strings translated, take a look at this: <a href="http://bugs.horde.org/ticket/9205">http://bugs.horde.org/ticket/9205</a>

\subsection{Translating Help Files}
First extract all new and changed entries from the English XML help file and merge them with the existing ones:<br />
\texttt{php translation.php update-help --module=MODULE --locale=xx\_XX}<br />
Then edit the help file for the necessary language using a text editor or vi:

<pre><code>
\$ vi horde/easyacdc/locale/xx\_XX/help.xml
</code></pre>
Finally<br />
\texttt{php translation.php make-help --module=MODULE --locale=xx\_XX}

\end{document}
