mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Fixed and clarified both the procedural and OOP variants, and updated examples. Addresses bug #53995.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@320463 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
db4dfaad2a
commit
ad1cf1f199
1 changed files with 19 additions and 13 deletions
|
@ -15,7 +15,7 @@
|
|||
<methodsynopsis>
|
||||
<type>array</type>
|
||||
<methodname>ResourceBundle::getLocales</methodname>
|
||||
<void />
|
||||
<methodparam><type>string</type><parameter>bundlename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Procedural style
|
||||
|
@ -23,13 +23,10 @@
|
|||
<methodsynopsis>
|
||||
<type>array</type>
|
||||
<methodname>resourcebundle_locales</methodname>
|
||||
<methodparam><type>ResourceBundle</type><parameter>r</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>bundlename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Get the list of locales supported by the bundle. The list is taken from the bundle table
|
||||
named <code>res_index</code> which should contain a table named <code>InstalledLocales</code>,
|
||||
which contains locales as keys. This bundle should be either in data directory as .res file or
|
||||
part of the .dat file for this function to work.
|
||||
Get available locales from ResourceBundle name.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -38,10 +35,11 @@
|
|||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>r</parameter></term>
|
||||
<term><parameter>bundlename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<classname>ResourceBundle</classname> object.
|
||||
Path of ResourceBundle for which to get available locales, or
|
||||
empty string for default locales list.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -64,23 +62,31 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$r = resourcebundle_create( 'es', "/usr/share/data/myapp");
|
||||
echo join("\n", resourcebundle_locales($r));
|
||||
$bundle = "/user/share/data/myapp";
|
||||
echo join(PHP_EOL, resourcebundle_locales($bundle);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
es
|
||||
root
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>OO example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$r = new ResourceBundle( 'es', "/usr/share/data/myapp");
|
||||
echo join("\n", $r->getLocales());
|
||||
$bundle = "/usr/share/data/myapp";
|
||||
$r = new ResourceBundle( 'es', $bundle);
|
||||
echo join("\n", $r->getLocales($bundle));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
es
|
||||
|
|
Loading…
Reference in a new issue