public static
array
|
#
createLanguageList( string $actualLanguage, string $basePath = JPATH_BASE, boolean $caching = false, boolean $installed = false )
Builds a list of the system languages which can be used in a select
option
Builds a list of the system languages which can be used in a select
option
Parameters
- $actualLanguage
string - $actualLanguage Client key for the area
- $basePath
string - $basePath Base path to use
- $caching
boolean - $caching True if caching is used
- $installed
boolean - $installed Get only installed languages
Returns
array - List of system languages
Since
11.1
|
public static
string
|
#
detectLanguage( )
Tries to detect the language.
Tries to detect the language.
Returns
string - locale or null if not found
Since
11.1
|
public static
array
|
#
getLanguages( string $key = 'default' )
Get available languages
Parameters
- $key
string - $key Array key
Returns
array - An array of published languages
Since
11.1
|
public static
array
|
#
getInstalledLanguages( integer $clientId = null, boolean $processMetaData = false, boolean $processManifest = false, string $pivot = 'element', string $orderField = null, string $orderDirection = null )
Get a list of installed languages.
Get a list of installed languages.
Parameters
- $clientId
integer - $clientId The client app id.
- $processMetaData
boolean - $processMetaData Fetch Language metadata.
- $processManifest
boolean - $processManifest Fetch Language manifest.
- $pivot
string - $pivot The pivot of the returning array.
- $orderField
string - $orderField Field to order the results.
- $orderDirection
string - $orderDirection Direction to order the results.
Returns
array - Array with the installed languages.
Since
3.7.0
|
public static
array
|
#
getContentLanguages( boolean $checkPublished = true, boolean $checkInstalled = true, string $pivot = 'lang_code', string $orderField = null, string $orderDirection = null )
Get a list of content languages.
Get a list of content languages.
Parameters
- $checkPublished
boolean - $checkPublished Check if the content language is published.
- $checkInstalled
boolean - $checkInstalled Check if the content language is installed.
- $pivot
string - $pivot The pivot of the returning array.
- $orderField
string - $orderField Field to order the results.
- $orderDirection
string - $orderDirection Direction to order the results.
Returns
array - Array of the content languages.
Since
3.7.0
|
public static
boolean
|
#
saveToIniFile( string $filename, array $strings )
Save strings to a language file.
Save strings to a language file.
Parameters
- $filename
string - $filename The language ini file path.
- $strings
array - $strings The array of strings.
Returns
boolean - True if saved, false otherwise.
Since
3.7.0
|
public static
boolean
|
#
exists( string $lang, string $basePath = JPATH_BASE )
Checks if a language exists.
Checks if a language exists.
This is a simple, quick check for the directory that should contain language
files for the given user.
Parameters
- $lang
string - $lang Language to check.
- $basePath
string - $basePath Optional path to check.
Returns
boolean - True if the language exists.
Since
3.7.0
|
public static
mixed
|
#
getMetadata( string $lang )
Returns an associative array holding the metadata.
Returns an associative array holding the metadata.
Parameters
- $lang
string - $lang The name of the language.
Returns
mixed - If $lang exists return key/value pair with the language metadata, otherwise
return NULL.
Since
3.7.0
|
public static
array
|
#
getKnownLanguages( string $basePath = JPATH_BASE )
Returns a list of known languages for an area
Returns a list of known languages for an area
Parameters
- $basePath
string - $basePath The basepath to use
Returns
array - key/value pair with the language file and real name.
Since
3.7.0
|
public static
string
|
#
getLanguagePath( string $basePath = JPATH_BASE, string $language = null )
Get the path to a language
Get the path to a language
Parameters
- $basePath
string - $basePath The basepath to use.
- $language
string - $language The language tag.
Returns
string - language related path or null.
Since
3.7.0
|
public static
array
|
#
parseLanguageFiles( string $dir = null )
Searches for language directories within a certain base dir.
Searches for language directories within a certain base dir.
Parameters
- $dir
string - $dir directory of files.
Returns
array - Array holding the found languages as filename => real name pairs.
Since
3.7.0
|
public static
array
|
#
parseXMLLanguageFile( string $path )
Parse XML file for language information.
Parse XML file for language information.
Parameters
- $path
string - $path Path to the XML files.
Returns
array - Array holding the found metadata as a key => value pair.
Throws
Since
3.7.0
|