-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for the new Script class
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |