<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xml:id="collator.getlocale" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>Collator::getLocale</refname> <refname>collator_get_locale</refname> <refpurpose>Get the locale name of the collator</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para> &style.oop; </para> <methodsynopsis> <modifier>public</modifier> <type>string</type> <methodname>Collator::getLocale</methodname> <methodparam><type>int</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> &style.procedural; </para> <methodsynopsis> <type>string</type> <methodname>collator_get_locale</methodname> <methodparam><type>Collator</type><parameter>coll</parameter></methodparam> <methodparam><type>int</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> Get collector locale name. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>coll</parameter></term> <listitem> <para> <classname>Collator</classname> object. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>type</parameter></term> <listitem> <para> You can choose between valid and actual locale ( <constant>Locale::VALID_LOCALE</constant> and <constant>Locale::ACTUAL_LOCALE</constant>, respectively). </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Real locale name from which the collation data comes. If the collator was instantiated from rules or an error occurred, returns <type>boolean</type> &false;. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>collator_get_locale</function> example</title> <programlisting role="php"> <![CDATA[ <?php $coll = collator_create( 'en_US_California' ); $res_val = collator_get_locale( $coll, Locale::VALID_LOCALE ); $res_act = collator_get_locale( $coll, Locale::ACTUAL_LOCALE ); printf( "Valid locale name: %s\nActual locale name: %s\n", $res_val, $res_act ); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Requested locale name: en_US_California Valid locale name: en_US Actual locale name: en ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>collator_create</function></member> </simplelist> </para> </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:"~/.phpdoc/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 -->