-
Notifications
You must be signed in to change notification settings - Fork 858
Expand file tree
/
Copy pathisrighttoleft.xml
More file actions
96 lines (86 loc) · 2.26 KB
/
isrighttoleft.xml
File metadata and controls
96 lines (86 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="locale.isrighttoleft"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Locale::isRightToLeft</refname>
<refpurpose>Check whether a locale uses a right-to-left writing system</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="Locale">
<modifier>public</modifier>
<modifier>static</modifier>
<type>bool</type>
<methodname>Locale::isRightToLeft</methodname>
<methodparam choice="opt">
<type>string</type><parameter>locale</parameter>
<initializer>""</initializer>
</methodparam>
</methodsynopsis>
<simpara>
Determines whether a locale uses a right-to-left writing system.
</simpara>
<simpara>
This method relies on the ICU library and evaluates the dominant script
associated with the locale.
</simpara>
<simpara>
If an empty string is provided, the default locale is used.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>locale</parameter></term>
<listitem>
<simpara>
The locale identifier. If empty, the default locale is used.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns &true; if the locale uses a right-to-left
writing system, or &false; otherwise.
</simpara>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>PHP 8.5.0</entry>
<entry>
Added <methodname>Locale::isRightToLeft</methodname>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Checking text direction for a locale</title>
<programlisting>
<![CDATA[
var_dump(Locale::isRightToLeft('en-US')); // bool(false)
var_dump(Locale::isRightToLeft('ar')); // bool(true)
]]>
</programlisting>
</example>
</refsect1>
</refentry>