svn: /phpdoc/ru/trunk/reference/gettext/functions/ gettext.xml

From: Date: Wed, 03 Aug 2011 11:15:38 +0000
Subject: svn: /phpdoc/ru/trunk/reference/gettext/functions/ gettext.xml
Groups: php.doc.ru 
Request: Send a blank email to doc-ru+get-2138@lists.php.net to get a copy of this message
mch Wed, 03 Aug 2011 11:15:38 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=314150 Log: Updated translation by Alex in reference/gettext/function section. Changed paths: U phpdoc/ru/trunk/reference/gettext/functions/gettext.xml Modified: phpdoc/ru/trunk/reference/gettext/functions/gettext.xml =================================================================== --- phpdoc/ru/trunk/reference/gettext/functions/gettext.xml 2011-08-03 11:13:12 UTC (rev 314149) +++ phpdoc/ru/trunk/reference/gettext/functions/gettext.xml 2011-08-03 11:15:38 UTC (rev 314150) @@ -1,53 +1,105 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: n/a Maintainer: shein Status: old --> +<!-- EN-Revision: 297028 Maintainer: mch Status: ready --> +<!-- Reviewed: no --> <!-- $Revision$ --> - <refentry xml:id="function.gettext" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>gettext</refname> - <refpurpose>Возвращает перевод сообщения</refpurpose> - </refnamediv> - <refsect1> - <title>Описание</title> - <methodsynopsis> - <type>string</type><methodname>gettext</methodname> - <methodparam><type>string</type><parameter>message</parameter></methodparam> - </methodsynopsis> - <para> - Возвращает перевод сообщения, найденный в текущем каталоге сообщений, - или оригинал, если перевод не найден. Псевдоним функции - '_'. - </para> - <example> - <title><function>gettext</function>-check</title> - <programlisting role="php"> +<refentry xml:id="function.gettext" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>gettext</refname> + <refpurpose>Ищет сообщение в текущем домене</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>string</type><methodname>gettext</methodname> + <methodparam><type>string</type><parameter>message</parameter></methodparam> + </methodsynopsis> + <para> + Ищет сообщение в текущем домене. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>message</parameter></term> + <listitem> + <para> + Сообщение, которое будет переведено. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Возвращает переведённую строку (<type>string</type>), если она найдена + в таблице перевода, иначе - переданное сообщение. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>gettext</function>-check</title> + <programlisting role="php"> <![CDATA[ <?php -// Установить язык в русский +// Установить русский язык +putenv('LC_ALL=ru_RU'); setlocale(LC_ALL, 'ru_RU'); -// Указать путь к каталогу сообщений +// Указать путь к таблицам переводов bindtextdomain("myPHPApp", "./locale"); -// Выбрать домены +// Выбрать домен textdomain("myPHPApp"); -// Теперь переводы будут искаться в ./locale/de_DE/LC_MESSAGES/myPHPApp.mo +// Теперь переводы будут искаться в ./locale/ru_RU/LC_MESSAGES/myPHPApp.mo // Вывести текстовое сообщение echo gettext("Welcome to My PHP Application"); -// То же самое +// Или с использованием псевдонима _() echo _("Have a nice day"); ?> ]]> - </programlisting> - </example> - <para> - См. также - <function>setlocale</function>. - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="notes"> + &reftitle.notes; + <note> + <para> + Можно использовать символ подчёркивания '_' как псевдоним этой функции. + </para> + </note> + <note> + <para> + Настроек языка может быть недостаточно на некоторых системах, в таких случаях + используйте <function>putenv</function> для указания текущей локали. + </para> + </note> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>setlocale</function></member> + </simplelist> + </para> + </refsect1> +</refentry> + <!-- Keep this comment at the end of the file Local variables: mode: sgml

« previous php.doc.ru (#2138) next »