LanguageFactory

Language package factory

since

1.3.0

package

Joomla Framework

Methods

getDefaultLanguage

Get the application's default language.

getDefaultLanguage() : string
since

1.3.0

Response

string

getLanguage

Creates a new Language instance based on the given parameters.

getLanguage(string lang = '', string path = '', bool debug = false) : \Joomla\Language\Language
since

1.3.0

Arguments

lang

stringThe language to use.

path

stringThe base path to the language folder. This is required if creating a new instance.

debug

boolThe debug mode.

Response

\Joomla\Language\Language

getLanguageDirectory

Get the path to the directory containing the application's language folder.

getLanguageDirectory() : string
since

1.3.0

Response

string

getLocalise

Creates a new LocaliseInterface instance for the language.

getLocalise(string lang, string basePath = '') : \Joomla\Language\LocaliseInterface
since

2.0.0-alpha

Arguments

lang

stringLanguage to check.

basePath

stringBase path to the language folder.

Response

\Joomla\Language\LocaliseInterface

getStemmer

Creates a new StemmerInterface instance for the requested adapter.

getStemmer(string adapter) : \Joomla\Language\StemmerInterface
since

1.3.0

throws

\Joomla\Language\RuntimeExceptionon invalid stemmer

Arguments

adapter

stringThe type of stemmer to load.

Response

\Joomla\Language\StemmerInterface

getText

Retrieves a new Text object for a Language instance

getText(\Joomla\Language\Language|null language = null) : \Joomla\Language\Text
since

2.0.0-alpha

Arguments

language

\Joomla\Language\Language|nullAn optional Language object to inject, otherwise the default object is loaded

Response

\Joomla\Language\Text

setDefaultLanguage

Set the application's default language

setDefaultLanguage(string language) : $this
since

1.3.0

Arguments

language

stringLanguage code for the application's default language

Response

$this

setLanguageDirectory

Set the path to the directory containing the application's language folder

setLanguageDirectory(string directory) : $this
since

2.0.0-alpha

Arguments

directory

stringPath to the application's language folder

Response

$this

Properties

defaultLanguage

Application's default language

since

1.3.0

Type(s)

string

languageDirectory

Path to the directory containing the application's language folder

since

2.0.0-alpha

Type(s)

string