-
Notifications
You must be signed in to change notification settings - Fork 842
Document Locale::isRightToLeft (PHP 8.5) #5055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
DanielEScherzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Methods are generally documented in their own dedicated files, that are then linked in the synopsis below (see the line <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo> and below it)
Its been a decade, but the last new Locale method documented seems to have been 53e4cea and you can see how that was documented - just create a new file
Looking through the commit log, it seems the most recent method addition documentation was 053ae3f so that can also be used for comparison - in addition to creating the new file, the versions information gets updated
|
@DanielEScherzer The documentation has been moved into a dedicated isrighttoleft.xml file. It is now automatically picked up by the existing Methods; include in locale.xml, consistent with other Locale methods. |
Girgias
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly markup nits.
| <programlisting><![CDATA[ | ||
| var_dump(Locale::isRightToLeft('en-US')); // bool(false) | ||
| var_dump(Locale::isRightToLeft('ar')); // bool(true) | ||
| ]]></programlisting> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <programlisting><![CDATA[ | |
| var_dump(Locale::isRightToLeft('en-US')); // bool(false) | |
| var_dump(Locale::isRightToLeft('ar')); // bool(true) | |
| ]]></programlisting> | |
| <programlisting> | |
| <![CDATA[ | |
| var_dump(Locale::isRightToLeft('en-US')); // bool(false) | |
| var_dump(Locale::isRightToLeft('ar')); // bool(true) | |
| ]]> | |
| </programlisting> |
| <para> | ||
| Returns <constant>true</constant> if the locale uses a right-to-left | ||
| writing system, or <constant>false</constant> otherwise. | ||
| </para> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <para> | |
| Returns <constant>true</constant> if the locale uses a right-to-left | |
| writing system, or <constant>false</constant> otherwise. | |
| </para> | |
| <simpara> | |
| Returns &true; if the locale uses a right-to-left | |
| writing system, or &false; otherwise. | |
| </simpara> |
| <refsect1 role="parameters"> | ||
| &reftitle.parameters; | ||
| <para> | ||
| <variablelist> | ||
| <varlistentry> | ||
| <term><parameter>locale</parameter></term> | ||
| <listitem> | ||
| <para> | ||
| The locale identifier. If empty, the default locale is used. | ||
| </para> | ||
| </listitem> | ||
| </varlistentry> | ||
| </variablelist> | ||
| </para> | ||
| </refsect1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also doesn't there exist an XML entity for the locale parameter by any chance?
| <refsect1 role="parameters"> | |
| &reftitle.parameters; | |
| <para> | |
| <variablelist> | |
| <varlistentry> | |
| <term><parameter>locale</parameter></term> | |
| <listitem> | |
| <para> | |
| The locale identifier. If empty, the default locale is used. | |
| </para> | |
| </listitem> | |
| </varlistentry> | |
| </variablelist> | |
| </para> | |
| </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="description"> | ||
| &reftitle.description; | ||
|
|
||
| <para> | ||
| &style.oop; | ||
| </para> | ||
|
|
||
| <methodsynopsis role="Locale"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is only an OOP version as far as I know?
| <refsect1 role="description"> | |
| &reftitle.description; | |
| <para> | |
| &style.oop; | |
| </para> | |
| <methodsynopsis role="Locale"> | |
| <refsect1 role="description"> | |
| &reftitle.description; | |
| <methodsynopsis role="Locale"> |
| <para> | ||
| Determines whether a locale uses a right-to-left writing system. | ||
| </para> | ||
|
|
||
| <para> | ||
| This method relies on the ICU library and evaluates the dominant script | ||
| associated with the locale. | ||
| </para> | ||
|
|
||
| <para> | ||
| If an empty string is provided, the default locale is used. | ||
| </para> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <para> | |
| Determines whether a locale uses a right-to-left writing system. | |
| </para> | |
| <para> | |
| This method relies on the ICU library and evaluates the dominant script | |
| associated with the locale. | |
| </para> | |
| <para> | |
| If an empty string is provided, the default locale is used. | |
| </para> | |
| <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> |
This PR adds documentation for
Locale::isRightToLeft(), which was introduced in PHP 8.5 but was not previously documented in the manual.The new section describes the method behavior, its reliance on ICU for determining text direction, and provides a simple usage example.
Fixes #5013