php-doc-en/reference/gettext/functions/gettext.xml
2002-05-24 18:55:24 +00:00

65 lines
1.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/gettext.xml, last change in rev 1.2 -->
<refentry id="function.gettext">
<refnamediv>
<refname>gettext</refname>
<refpurpose>Lookup a message in the current domain</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>gettext</methodname>
<methodparam><type>string</type><parameter>message</parameter></methodparam>
</methodsynopsis>
<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 the underscore character '_' as an alias to this function.
</para>
<example>
<title><function>gettext</function>-check</title>
<programlisting>
<![CDATA[
<?php
// Set language to German
setlocale(LC_ALL, 'de');
// Specify location of translation tables
bindtextdomain("myPHPApp", "./locale");
// Choose domain
textdomain("myPHPApp");
// Print a test message
print gettext("Welcome to My PHP Application");
// Or use the alias _() for gettext()
print _("Have a nice day");
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- 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
indent-tabs-mode:nil
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
-->