<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.translate.introduction">

    <title>Introduction</title>

    <para>
        <classname>Zend_Translate</classname> is Zend Framework's solution for multilingual
        applications.
    </para>

    <para>
        In multilingual applications, the content must be translated into
        several languages and display content depending on the user's language.
        PHP offers already several ways to handle such problems, however
        the PHP solution has some problems:
    </para>

    <itemizedlist>
        <listitem>
            <para>
                <emphasis role="strong">Inconsistent API:</emphasis>
                There is no single API for the different source formats.
                The usage of gettext for example is very complicated.
            </para>
        </listitem>
        <listitem>
            <para>
                <emphasis role="strong">PHP supports only gettext and native array:</emphasis>
                PHP itself offers only support for array or gettext.
                All other source formats have to be coded manually,
                because there is no native support.
            </para>
        </listitem>
        <listitem>
            <para>
                <emphasis role="strong">No detection of the default language:</emphasis>
                The default language of the user cannot be detected without
                deeper knowledge of the backgrounds for
                the different web browsers.
            </para>
        </listitem>
        <listitem>
            <para>
                <emphasis role="strong">Gettext is not thread-safe:</emphasis>
                PHP's gettext library is not thread safe, and it
                should not be used in a multithreaded environment.
                This is due to problems with gettext itself, not PHP,
                but it is an existing problem.
            </para>
        </listitem>
    </itemizedlist>

    <para>
        <classname>Zend_Translate</classname> does not have the above problems. This is why we
        recommend using <classname>Zend_Translate</classname> instead of PHP's native functions.
        The benefits of <classname>Zend_Translate</classname> are:
    </para>

    <itemizedlist>
        <listitem>
            <para>
                <emphasis role="strong">Supports multiple source formats:</emphasis>
                <classname>Zend_Translate</classname> supports several source formats, including
                those supported by PHP, and other formats including TMX
                and CSV files.
            </para>
        </listitem>
        <listitem>
            <para>
                <emphasis role="strong">Thread-safe gettext:</emphasis>
                The gettext reader of <classname>Zend_Translate</classname> is thread-safe.
                There are no problems using it in multi-threaded environments.
            </para>
        </listitem>
        <listitem>
            <para>
                <emphasis role="strong">Easy and generic API:</emphasis>
                The API of <classname>Zend_Translate</classname> is very simple and requires only a
                handful of functions.
                So it's easy to learn and easy to maintain.
                All source formats are handled the same way, so if the format
                of your source files change from Gettext to TMX,
                you only need to change one line of code to specify the
                storage adapter.
            </para>
        </listitem>
        <listitem>
            <para>
                <emphasis role="strong">Detection of the user's standard language:</emphasis>
                The preferred language of the user accessing the site can be
                detected and used by <classname>Zend_Translate</classname>.
            </para>
        </listitem>
        <listitem>
            <para>
                <emphasis role="strong">Automatic source detection:</emphasis>
                <classname>Zend_Translate</classname> is capable of detecting and integrating multiple source files
                and additionally detect the locale to be used depending on directory or filenames.
            </para>
        </listitem>
    </itemizedlist>

    <sect2 id="zend.translate.introduction.adapters">

        <title>Starting multi-lingual</title>

        <para>
            So let's get started with multi-lingual business.
            What we want to do is translate our string
            output so the view produces the translated output.
            Otherwise we would have to write one view
            for each language, and no one would like to do this.
            Generally, multi-lingual sites are very simple in their design.
            There are only four steps you would have to do:
        </para>

        <orderedlist numeration='arabic'>
            <listitem>
                <para>
                    Decide which adapter you want to use;
                </para>
            </listitem>
            <listitem>
                <para>
                    Create your view and integrate <classname>Zend_Translate</classname> in your code;
                </para>
            </listitem>
            <listitem>
                <para>
                    Create the source file from your code;
                </para>
            </listitem>
            <listitem>
                <para>
                    Translate your source file to the desired language.
                </para>
            </listitem>
        </orderedlist>

        <para>
            The following sections guide you through all four steps.
            Read through the next few pages to create your own
            multi-lingual web application.
        </para>

    </sect2>

</sect1>
<!--
vim:se ts=4 sw=4 et:
-->
