PHP Class Inpsyde\MultilingualPress\Common\Type\AliasAwareLanguage

Since: 3.0.0
Inheritance: implements Inpsyde\MultilingualPress\Common\Type\Language
Datei anzeigen Open project: inpsyde/multilingual-press

Public Methods

Method Description
__construct ( array $data ) Constructor. Sets up the properies.
is_rtl ( ) : boolean Checks if the language is written right-to-left (RTL).
name ( string $output = 'native' ) : string Returns the language name (or code) according to the given argument.
priority ( ) : integer Returns the language priority.

Private Methods

Method Description
get_names ( array $data ) : string[] Returns the complete set of language names and codes for the given language data.

Method Details

__construct() public method

Constructor. Sets up the properies.
Since: 3.0.0
public __construct ( array $data )
$data array Language data.

is_rtl() public method

Checks if the language is written right-to-left (RTL).
Since: 3.0.0
public is_rtl ( ) : boolean
return boolean Whether or not the language is written right-to-left (RTL).

name() public method

Returns the language name (or code) according to the given argument.
Since: 3.0.0
public name ( string $output = 'native' ) : string
$output string Optional. Output type. Defaults to 'native'. TODO: Check/Adapt formatting to provide best possible readibility for both inline and rendered documentation. Possible values: * native: Native name of the language (default, e.g., "Deutsch" for German). * english: English name of the language. * custom: Language name as defined in the site settings. * text: Alias for "custom". * http: HTTP code of the language (e.g., "de-DE"). * language_long: Alias for "http". * language_short: First part of "http" (e.g., "de" for "de-DE"). * lang: Alias for "language_short". * wp_locale: WordPress locale representing the language. * none: No text output (e.g,. for displaying the flag icon only).
return string Language name (or code) according to the given argument.

priority() public method

Returns the language priority.
Since: 3.0.0
public priority ( ) : integer
return integer Language priority.