[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Language/ -> LanguageHelper.php (summary)

Joomla! Content Management System

Copyright: (C) 2007 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 630 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

LanguageHelper:: (13 methods):
  createLanguageList()
  detectLanguage()
  getLanguages()
  getInstalledLanguages()
  getContentLanguages()
  parseIniFile()
  saveToIniFile()
  exists()
  getMetadata()
  getKnownLanguages()
  getLanguagePath()
  parseLanguageFiles()
  parseXMLLanguageFile()


Class: LanguageHelper  - X-Ref

Language helper class

createLanguageList($actualLanguage, $basePath = JPATH_BASE, $caching = false, $installed = false)   X-Ref
Builds a list of the system languages which can be used in a select option

param: string   $actualLanguage  Client key for the area
param: string   $basePath        Base path to use
param: boolean  $caching         True if caching is used
param: boolean  $installed       Get only installed languages
return: array  List of system languages

detectLanguage()   X-Ref
Tries to detect the language.

return: string  locale or null if not found

getLanguages($key = 'default')   X-Ref
Get available languages

param: string  $key  Array key
return: array  An array of published languages

getInstalledLanguages($clientId = null,$processMetaData = false,$processManifest = false,$pivot = 'element',$orderField = null,$orderDirection = null)   X-Ref
Get a list of installed languages.

param: integer  $clientId         The client app id.
param: boolean  $processMetaData  Fetch Language metadata.
param: boolean  $processManifest  Fetch Language manifest.
param: string   $pivot            The pivot of the returning array.
param: string   $orderField       Field to order the results.
param: string   $orderDirection   Direction to order the results.
return: array  Array with the installed languages.

getContentLanguages($publishedStates = array(1)   X-Ref
Get a list of content languages.

param: array    $publishedStates  Array with the content language published states. Empty array for all.
param: boolean  $checkInstalled   Check if the content language is installed.
param: string   $pivot            The pivot of the returning array.
param: string   $orderField       Field to order the results.
param: string   $orderDirection   Direction to order the results.
return: array  Array of the content languages.

parseIniFile($fileName, $debug = false)   X-Ref
Parse strings from a language file.

param: string   $fileName  The language ini file path.
param: boolean  $debug     If set to true debug language ini file.
return: array  The strings parsed.

saveToIniFile($fileName, array $strings)   X-Ref
Save strings to a language file.

param: string  $fileName  The language ini file path.
param: array   $strings   The array of strings.
return: boolean  True if saved, false otherwise.

exists($lang, $basePath = JPATH_BASE)   X-Ref
Checks if a language exists.

This is a simple, quick check for the directory that should contain language files for the given user.

param: string  $lang      Language to check.
param: string  $basePath  Optional path to check.
return: boolean  True if the language exists.

getMetadata($lang)   X-Ref
Returns an associative array holding the metadata.

param: string  $lang  The name of the language.
return: mixed  If $lang exists return key/value pair with the language metadata, otherwise return NULL.

getKnownLanguages($basePath = JPATH_BASE)   X-Ref
Returns a list of known languages for an area

param: string  $basePath  The basepath to use
return: array  key/value pair with the language file and real name.

getLanguagePath($basePath = JPATH_BASE, $language = null)   X-Ref
Get the path to a language

param: string  $basePath  The basepath to use.
param: string  $language  The language tag.
return: string  language related path or null.

parseLanguageFiles($dir = null)   X-Ref
Searches for language directories within a certain base dir.

param: string  $dir  directory of files.
return: array  Array holding the found languages as filename => real name pairs.

parseXMLLanguageFile($path)   X-Ref
Parse XML file for language information.

param: string  $path  Path to the XML files.
return: array  Array holding the found metadata as a key => value pair.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer