php-doc-en/functions/gettext.xml
Hartmut Holzgraefe 9410c19fda added version attribute to <?xml tags
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@61864 c90b9560-bf6c-de11-be94-00142212c4b1
2001-11-10 21:49:43 +00:00

159 lines
4.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<reference id="ref.gettext">
<title>Gettext</title>
<titleabbrev>gettext</titleabbrev>
<partintro>
<simpara>
The gettext functions implement a NLS (Native Language Support)
API which can be used to internationalize your PHP applications.
Please see the gettext documentation from your system for a thorough
explanation of these functions.
</simpara>
</partintro>
<refentry id="function.bindtextdomain">
<refnamediv>
<refname>bindtextdomain</refname>
<refpurpose>Sets the path for a domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>string <function>bindtextdomain</function></funcdef>
<paramdef>string <parameter>domain</parameter></paramdef>
<paramdef>string <parameter>directory</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
The <function>bindtextdomain</function> function sets the path
for a domain.
</para>
</refsect1>
</refentry>
<refentry id="function.dcgettext">
<refnamediv>
<refname>dcgettext</refname>
<refpurpose>Overrides the domain for a single lookup</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>string <function>dcgettext</function></funcdef>
<paramdef>string <parameter>domain</parameter></paramdef>
<paramdef>string <parameter>message</parameter></paramdef>
<paramdef>int <parameter>category</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
This function allows you to override the current domain for a
single message lookup. It also allows you to specify a category.
</para>
</refsect1>
</refentry>
<refentry id="function.dgettext">
<refnamediv>
<refname>dgettext</refname>
<refpurpose>Override the current domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>string <function>dgettext</function></funcdef>
<paramdef>string <parameter>domain</parameter></paramdef>
<paramdef>string <parameter>message</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
The <function>dgettext</function> function allows you to override
the current domain for a single message lookup.
</para>
</refsect1>
</refentry>
<refentry id="function.gettext">
<refnamediv>
<refname>gettext</refname>
<refpurpose>Lookup a message in the current domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>string <function>gettext</function></funcdef>
<paramdef>string <parameter>message</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
This function returns a translated string if one is found in the
translation table, or the submitted message if not found. You may
use an underscore character as an alias to this function.
</para>
<example>
<title><function>gettext</function>-check</title>
<programlisting>
&lt;?php
// Set language to German
putenv ("LANG=de");
// Specify location of translation tables
bindtextdomain ("myPHPApp", "./locale");
// Choose domain
textdomain ("myPHPApp");
// Print a test message
print (gettext ("Welcome to My PHP Application"));
?>
</programlisting>
</example>
</refsect1>
</refentry>
<refentry id="function.textdomain">
<refnamediv>
<refname>textdomain</refname>
<refpurpose>Sets the default domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>string <function>textdomain</function></funcdef>
<paramdef>string <parameter>text_domain</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
This function sets the domain to search within when calls are
made to <function>gettext</function>, usually the named after an
application. The previous default domain is returned.
Call it with &null; as parameter to get the current setting without
changing it.
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->