Punic v3.8.2-dev
  • Namespace
  • Class
  • Tree
  • Todo
  • Deprecated

Namespaces

  • Punic
    • Exception

Classes

  • Calendar
  • Comparer
  • Currency
  • Data
  • Language
  • Misc
  • Number
  • Phone
  • Plural
  • Script
  • Territory
  • Unit

Exceptions

  • Exception

Class Script

Script helper stuff.

Namespace: Punic
Located at Script.php

Methods summary

public static string[]
# getAllScriptCodes( )

Get the list of all the script codes.

Get the list of all the script codes.

Returns

string[]
public static string[]
# getAvailableScriptCodes( string $locale )

Get the list of all the available script codes that have a translation for a specific language.

Get the list of all the available script codes that have a translation for a specific language.

Parameters

$locale
The locale to use. If empty we'll use the default locale set in \Punic\Data

Returns

string[]
public static string
# getScriptName( string|mixed $scriptCode, string $preferredVariant = '', boolean $fallbackToEnglish = true, string $locale = '' )

Get the name of a script given its code.

Get the name of a script given its code.

Parameters

$scriptCode
the script code
$preferredVariant
the preferred variant (valid values are the values of the ALTERNATIVENAME_... constants)
$fallbackToEnglish
some languages may be missing translation for some scripts: should we look for English names in this case?
$locale
The locale to use. If empty we'll use the default locale set in \Punic\Data

Returns

string
empty string if $scriptCode is not a valid script code

See

\Punic\Script::ALTERNATIVENAME_SECONDARY
\Punic\Script::ALTERNATIVENAME_VARIANT
\Punic\Script::ALTERNATIVENAME_SHORT
\Punic\Script::ALTERNATIVENAME_STANDALONE
public static array
# getAllScripts( string $preferredVariant = '', boolean $fallbackToEnglish = true, string $locale = '' )

Get all the scripts.

Get all the scripts.

Parameters

$preferredVariant
the preferred variant (valid values are the values of the ALTERNATIVENAME_... constants)
$fallbackToEnglish
some languages may be missing translation for some scripts: should we look for English names in this case?
$locale
The locale to use. If empty we'll use the default locale set in \Punic\Data

Returns

array
Array keys are the script codes, array values are the script names (the array is sorted by the values)

See

\Punic\Script::ALTERNATIVENAME_SECONDARY
\Punic\Script::ALTERNATIVENAME_VARIANT
\Punic\Script::ALTERNATIVENAME_SHORT
\Punic\Script::ALTERNATIVENAME_STANDALONE

Constants summary

string ALTERNATIVENAME_SECONDARY

Script alternative name: secondary.

Script alternative name: secondary.

# 'secondary'
string ALTERNATIVENAME_VARIANT

Script alternative name: variant.

Script alternative name: variant.

# 'variant'
string ALTERNATIVENAME_SHORT

Script alternative name: short.

Script alternative name: short.

# 'short'
string ALTERNATIVENAME_STANDALONE

Script alternative name: stand alone.

Script alternative name: stand alone.

# 'stand-alone'
Punic v3.8.2-dev API documentation generated by ApiGen