<commit_before><sect1 id="zend.translate.adapter">

    <title>Adapters for Zend_Translate</title>

    <para>
        Zend_Translate can handle different adapters for translation.
        Each adapter has its own advantages and disadvantages.
        Below is a comprehensive list of all supported adapters for
        translation source files.
    </para>

    <table id="zend.translate.adapter.table">
        <title>Adapters for Zend_Translate</title>
        <tgroup cols="3">
            <thead>
                <row>
                    <entry>Adapter</entry>
                    <entry>Description</entry>
                    <entry>Usage</entry>
                </row>
            </thead>
            <tbody>
                <row>
                    <entry>Array</entry>
                    <entry>Use php arrays</entry>
                    <entry>Small pages; simplest usage; only for programmers</entry>
                </row>
                <row>
                    <entry>Csv</entry>
                    <entry>Use comma seperated (*.csv/*.txt) files</entry>
                    <entry>Simple text file format; very fast; possible problems with unicode characters</entry>
                </row>
                <row>
                    <entry>Gettext</entry>
                    <entry>Use binary gettext (*.mo) files</entry>
                    <entry>GNU standard for linux; very fast; thread-safe; needs tools for translation</entry>
                </row>
                <row>
                    <entry>Ini</entry>
                    <entry>Use simple ini (*.ini) files</entry>
                    <entry>Simple text file format; very fast; possible problems with unicode characters</entry>
                </row>
                <row>
                    <entry>Tbx</entry>
                    <entry>Use termbase exchange (*.tbx/*.xml) files</entry>
                    <entry>Industry standard for inter application terminology strings; XML format</entry>
                </row>
                <row>
                    <entry>Tmx</entry>
                    <entry>Use tmx (*.tmx/*.xml) files</entry>
                    <entry>Industry standard for inter application translation; XML format; human readable</entry>
                </row>
                <row>
                    <entry>Qt</entry>
                    <entry>Use qt linguist (*.ts) files</entry>
                    <entry>Cross platform application framework; XML format; human readable</entry>
                </row>
                <row>
                    <entry>Xliff</entry>
                    <entry>Use xliff (*.xliff/*.xml) files</entry>
                    <entry>A simpler format as TMX but related to it; XML format; human readable</entry>
                </row>
                <row>
                    <entry>XmlTm</entry>
                    <entry>Use xmltm (*.xml) files</entry>
                    <entry>Industry standard for XML document translation memory; XML format; human readable</entry>
                </row>
                <row>
                    <entry>Others</entry>
                    <entry>*.sql</entry>
                    <entry>Different other adapters may be implemented in the future</entry>
                </row>
            </tbody>
        </tgroup>
    </table>

    <sect2 id="zend.translate.adapter.decision">

        <title>How to decide which translation adapter to use</title>

        <para>
            You should decide which Adapter you want to use for Zend_Translate.
            Frequently, external criteria such as a project requirement or
            a customer requirement determines this for you, but if you are in
            the position to do this yourself, the following hints may simplify
            your decision.
        </para>

        <note>
            <para>
                When deciding your adapter you should also be aware of the used
                encoding. Even if the Zend Framework declares UTF-8 as default
                encoding you will sometimes be in the need of other encoding.
                <code>Zend_Translate</code> will not change any encoding which is defined
                within the source file which means that if your Gettext source
                is build upon ISO-8859-1 it will also return strings in this encoding
                without converting them. There is only one restriction:
            </para>

            <para>
                When you use a xml based source format like TMX or XLIFF you must
                define the encoding within the xml files header because xml files
                without defined encoding will be treated as UTF-8 by any xml parser
                by default. You should also be aware that actually the encoding of
                xml files is limited to the encodings supported by PHP which are
                UTF-8, ISO-8859-1 and US-ASCII.
            </para>
        </note>

        <sect3 id="zend.translate.adapter.array">

            <title>Zend_Translate_Adapter_Array</title>

            <para>
                The Array Adapter is the Adapter which is simplest to use for
                programmers.
                But when you have numerous translation strings or many
                languages you should think about another Adapter.
                For example, if you have 5000 translation strings,
                the Array Adapter is possibly not the best choice for you.
            </para>

            <para>
                You should only use this Adapter for small sites with a handful
                of languages, and if you or your programmer team creates the
                translations yourselves.
            </para>
        </sect3>

        <sect3 id="zend.translate.adapter.csv">

            <title>Zend_Translate_Adapter_Csv</title>

            <para>
                The Csv Adapter is the Adapter which is simplest to use for
                customers.
                CSV files are readable by standard text editors, but
                text editors often do not support utf8 character sets.
            </para>

            <para>
                You should only use this Adapter if your customer wants to do
                translations himself.
            </para><commit_msg>Zend_Translate_Adapter_Csv:  - added note related to PHP bug (ZF-3890)<commit_after><sect1 id="zend.translate.adapter">

    <title>Adapters for Zend_Translate</title>

    <para>
        Zend_Translate can handle different adapters for translation.
        Each adapter has its own advantages and disadvantages.
        Below is a comprehensive list of all supported adapters for
        translation source files.
    </para>

    <table id="zend.translate.adapter.table">
        <title>Adapters for Zend_Translate</title>
        <tgroup cols="3">
            <thead>
                <row>
                    <entry>Adapter</entry>
                    <entry>Description</entry>
                    <entry>Usage</entry>
                </row>
            </thead>
            <tbody>
                <row>
                    <entry>Array</entry>
                    <entry>Use php arrays</entry>
                    <entry>Small pages; simplest usage; only for programmers</entry>
                </row>
                <row>
                    <entry>Csv</entry>
                    <entry>Use comma seperated (*.csv/*.txt) files</entry>
                    <entry>Simple text file format; very fast; possible problems with unicode characters</entry>
                </row>
                <row>
                    <entry>Gettext</entry>
                    <entry>Use binary gettext (*.mo) files</entry>
                    <entry>GNU standard for linux; very fast; thread-safe; needs tools for translation</entry>
                </row>
                <row>
                    <entry>Ini</entry>
                    <entry>Use simple ini (*.ini) files</entry>
                    <entry>Simple text file format; very fast; possible problems with unicode characters</entry>
                </row>
                <row>
                    <entry>Tbx</entry>
                    <entry>Use termbase exchange (*.tbx/*.xml) files</entry>
                    <entry>Industry standard for inter application terminology strings; XML format</entry>
                </row>
                <row>
                    <entry>Tmx</entry>
                    <entry>Use tmx (*.tmx/*.xml) files</entry>
                    <entry>Industry standard for inter application translation; XML format; human readable</entry>
                </row>
                <row>
                    <entry>Qt</entry>
                    <entry>Use qt linguist (*.ts) files</entry>
                    <entry>Cross platform application framework; XML format; human readable</entry>
                </row>
                <row>
                    <entry>Xliff</entry>
                    <entry>Use xliff (*.xliff/*.xml) files</entry>
                    <entry>A simpler format as TMX but related to it; XML format; human readable</entry>
                </row>
                <row>
                    <entry>XmlTm</entry>
                    <entry>Use xmltm (*.xml) files</entry>
                    <entry>Industry standard for XML document translation memory; XML format; human readable</entry>
                </row>
                <row>
                    <entry>Others</entry>
                    <entry>*.sql</entry>
                    <entry>Different other adapters may be implemented in the future</entry>
                </row>
            </tbody>
        </tgroup>
    </table>

    <sect2 id="zend.translate.adapter.decision">

        <title>How to decide which translation adapter to use</title>

        <para>
            You should decide which Adapter you want to use for Zend_Translate.
            Frequently, external criteria such as a project requirement or
            a customer requirement determines this for you, but if you are in
            the position to do this yourself, the following hints may simplify
            your decision.
        </para>

        <note>
            <para>
                When deciding your adapter you should also be aware of the used
                encoding. Even if the Zend Framework declares UTF-8 as default
                encoding you will sometimes be in the need of other encoding.
                <code>Zend_Translate</code> will not change any encoding which is defined
                within the source file which means that if your Gettext source
                is build upon ISO-8859-1 it will also return strings in this encoding
                without converting them. There is only one restriction:
            </para>

            <para>
                When you use a xml based source format like TMX or XLIFF you must
                define the encoding within the xml files header because xml files
                without defined encoding will be treated as UTF-8 by any xml parser
                by default. You should also be aware that actually the encoding of
                xml files is limited to the encodings supported by PHP which are
                UTF-8, ISO-8859-1 and US-ASCII.
            </para>
        </note>

        <sect3 id="zend.translate.adapter.array">

            <title>Zend_Translate_Adapter_Array</title>

            <para>
                The Array Adapter is the Adapter which is simplest to use for
                programmers.
                But when you have numerous translation strings or many
                languages you should think about another Adapter.
                For example, if you have 5000 translation strings,
                the Array Adapter is possibly not the best choice for you.
            </para>

            <para>
                You should only use this Adapter for small sites with a handful
                of languages, and if you or your programmer team creates the
                translations yourselves.
            </para>
        </sect3>

        <sect3 id="zend.translate.adapter.csv">

            <title>Zend_Translate_Adapter_Csv</title>

            <para>
                The Csv Adapter is the Adapter which is simplest to use for
                customers.
                CSV files are readable by standard text editors, but
                text editors often do not support utf8 character sets.
            </para>

            <para>
                You should only use this Adapter if your customer wants to do
                translations himself.
            </para>

            <note>
                <para>
                    Beware that the Csv Adapter has problems when your Csv files are encoded differently than
                    the locale setting of your environment. This is due to a Bug of PHP itself which will not
                    be fixed before PHP 6.0 (http://bugs.php.net/bug.php?id=38471). So you should be aware
                    that the Csv Adapter due to PHP restrictions is not locale aware.
                </para>
            </note>
{'fraction_non_alphanumeric': 0.07243614182234083, 'fraction_numerical': 0.004498665650019062, 'mean_word_length': 1.4429130191842057, 'pattern_counts': {'":': 0, '<': 269, '<?xml version=': 0, '>': 269, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5395478', 'n_tokens_mistral': 3266, 'n_tokens_neox': 2937, 'n_words': 1182}