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