Skip to content

Commit

Permalink
Add documentation for the new Script class
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Jun 24, 2021
1 parent d012551 commit 308525f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/src/classes/script.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*************************
``Punic\Script`` class
*************************

The Script class contains several methods to work with Scripts (Script is the Unicode term that defines how languages are written, like `Latin` or `Traditional Han`).

.. code-block:: php
use Punic\Script;
var_dump(Territory::getAllScriptCodes());
// Output: the identifiers of all the available scripts
var_dump(Territory::getAvailableScriptCodes('en'));
// Output: the identifiers of all the scripts that have available translations in a specific language
echo Script::getScriptName('Hant');
// Output: the translated name of the Hant script
var_dump(Territory::getAllScripts());
// Output: an array whose array are the script identifiers and the values are the translated script names

0 comments on commit 308525f

Please sign in to comment.