Punic APIs
  • Namespace
  • Class
  • Tree
  • Todo

Namespaces

  • Punic
    • Exception

Classes

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

Exceptions

  • Exception

Class Language

Language-related stuff.

Namespace: Punic
Located at Language.php

Methods summary

public static array
# getAll( boolean $excludeCountrySpecific = false, boolean $excludeScriptSpecific = false, string $locale = '' )

Return all the languages.

Return all the languages.

Parameters

$excludeCountrySpecific
Set to false (default) to include also Country-specific languages (eg 'U.S. English' in addition to 'English'), set to true to exclude them
$excludeScriptSpecific
Set to false (default) to include also script-specific languages (eg 'Simplified Chinese' in addition to 'Chinese'), set to true to exclude them
$locale
The locale to use. If empty we'll use the default locale set in \Punic\Data

Returns

array
Return an array, sorted by values, whose keys are the language IDs and the values are the localized language names
public static string
# getName( string $languageCode, string $locale = '', boolean $allowCompoundNames = false )

Retrieve the name of a language.

Retrieve the name of a language.

Parameters

$languageCode
The language code. If it contails also a terrotory code (eg: 'en-US'), the result will contain also the territory code (eg 'English (United States)')
$locale
The locale to use. If empty we'll use the default locale set in \Punic\Data
$allowCompoundNames
Set to true to allow compound names (eg 'American English (United States)' instead of 'English (United States)')

Returns

string
Returns the localized language name (returns $languageCode if not found)
Punic APIs API documentation generated by ApiGen