class LanguageBundle extends LanguageDataProvider implements LanguageBundleInterface

Default implementation of {@link LanguageBundleInterface}.

Methods

__construct(string $path, BundleEntryReaderInterface $reader, LocaleDataProvider $localeProvider, ScriptDataProvider $scriptProvider)

Creates a new language bundle.

getLanguages()

No description

getAliases()

No description

getName($language, $displayLocale = null)

No description

getNames($displayLocale = null)

No description

getAlpha3Code($language)

No description

string|null
getLanguageName(string $language, string|null $region = null, string $displayLocale = null)

Returns the name of a language.

string[]
getLanguageNames(string $displayLocale = null)

Returns the names of all known languages.

string|null
getScriptName(string $script, string $language = null, string $displayLocale = null)

Returns the name of a script.

string[]
getScriptNames(string $displayLocale = null)

Returns the names of all known scripts.

string[]
getLocales()

Returns the list of locales that this bundle supports.

Details

at line line 40
__construct(string $path, BundleEntryReaderInterface $reader, LocaleDataProvider $localeProvider, ScriptDataProvider $scriptProvider)

Creates a new language bundle.

Parameters

string $path The path to the directory containing the .res files
BundleEntryReaderInterface $reader The reader for reading the .res files
LocaleDataProvider $localeProvider
ScriptDataProvider $scriptProvider

in LanguageDataProvider at line line 41
getLanguages()

in LanguageDataProvider at line line 46
getAliases()

in LanguageDataProvider at line line 51
getName($language, $displayLocale = null)

Parameters

$language
$displayLocale

in LanguageDataProvider at line line 60
getNames($displayLocale = null)

Parameters

$displayLocale

in LanguageDataProvider at line line 78
getAlpha3Code($language)

Parameters

$language

at line line 51
string|null getLanguageName(string $language, string|null $region = null, string $displayLocale = null)

Returns the name of a language.

Parameters

string $language A language code (e.g. "en")
string|null $region Optional. A region code (e.g. "US")
string $displayLocale Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}.

Return Value

string|null The name of the language or NULL if not found

at line line 72
string[] getLanguageNames(string $displayLocale = null)

Returns the names of all known languages.

Parameters

string $displayLocale Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}.

Return Value

string[] A list of language names indexed by language codes

at line line 84
string|null getScriptName(string $script, string $language = null, string $displayLocale = null)

Returns the name of a script.

Parameters

string $script A script code (e.g. "Hans")
string $language Optional. A language code (e.g. "zh")
string $displayLocale Optional. The locale to return the name in Defaults to {@link \Locale::getDefault()}.

Return Value

string|null The name of the script or NULL if not found

at line line 96
string[] getScriptNames(string $displayLocale = null)

Returns the names of all known scripts.

Parameters

string $displayLocale Optional. The locale to return the names in Defaults to {@link \Locale::getDefault()}.

Return Value

string[] A list of script names indexed by script codes

at line line 108
string[] getLocales()

Returns the list of locales that this bundle supports.

Return Value

string[] A list of locale codes