LanguageHelper
Helper class for the Language package
| since |
2.0 |
|---|---|
| package |
Joomla Framework |
Methods
exists
Checks if a language exists.
exists( lang, basePath) :
This is a simple, quick check for the directory that should contain language files for the given user.
| since |
2.0 |
|---|
Arguments
- lang
stringLanguage to check.- basePath
stringDirectory to check for the specified language.
Response
boolTrue if the language exists.
getKnownLanguages
Returns a list of known languages for an area
getKnownLanguages( basePath) : mixed||string|int
| since |
2.0 |
|---|
Arguments
- basePath
stringThe basepath to use
Response
array<string|int, mixed>key/value pair with the language file and real name.
getLanguagePath
Get the path to a language
getLanguagePath( basePath, language = '') :
| since |
2.0 |
|---|
Arguments
- basePath
stringThe basepath to use.- language
stringThe language tag.
Response
stringPath to the language folder
getMetadata
Returns a associative array holding the metadata.
getMetadata( lang, path) : array|null
| since |
2.0 |
|---|
Arguments
- lang
stringThe name of the language.- path
stringThe filepath to the language folder.
Response
array<string|int, mixed>|nullIf $lang exists return key/value pair with the language metadata, otherwise return NULL.
parseLanguageFiles
Searches for language directories within a certain base dir.
parseLanguageFiles( dir = '') : mixed||string|int
| since |
2.0 |
|---|
Arguments
- dir
stringdirectory of files.
Response
array<string|int, mixed>Array holding the found languages as filename => real name pairs.
parseXmlLanguageFile
Parse XML file for language information.
parseXmlLanguageFile( path) : array|null
| since |
2.0 |
|---|---|
| throws |
|
Arguments
- path
stringPath to the XML files.
Response
array<string|int, mixed>|nullArray holding the found metadata as a key => value pair.