Back to Joomla project (class list)

Class LanguageHelper - list of methods

Language helper class
Package: Joomla\CMS\Language
Copyright: (C) 2007 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Language/LanguageHelper.php
Project: Joomla

Method Summary

public static array
(mixed $actualLanguage, mixed $basePath = JPATH_BASE, mixed $caching = false, mixed $installed = false)

Builds a list of the system languages which can be used in a select option
Parameters
  • string $actualLanguage Client key for the area
  • string $basePath Base path to use
  • bool $caching True if caching is used
  • bool $installed Get only installed languages
Returns
  • array List of system languages
Since
  • 1.5
Show source code of this method: createLanguageList Source Code

public static string
()

Tries to detect the language.
Returns
  • string locale or null if not found
Since
  • 1.5
Show source code of this method: detectLanguage Source Code

public static array
(mixed $key = 'default')

Get available languages
Parameters
  • string $key Array key
Returns
  • array An array of published languages
Since
  • 1.6
Show source code of this method: getLanguages Source Code

public static array
(mixed $clientId = null, mixed $processMetaData = false, mixed $processManifest = false, mixed $pivot = 'element', mixed $orderField = null, mixed $orderDirection = null)

Get a list of installed languages.
Parameters
  • int $clientId The client app id.
  • bool $processMetaData Fetch Language metadata.
  • bool $processManifest Fetch Language manifest.
  • string $pivot The pivot of the returning array.
  • string $orderField Field to order the results.
  • string $orderDirection Direction to order the results.
Returns
  • array Array with the installed languages.
Since
  • 3.7.0
Show source code of this method: getInstalledLanguages Source Code

public static array
(mixed $publishedStates = array(1), mixed $checkInstalled = true, mixed $pivot = 'lang_code', mixed $orderField = null, mixed $orderDirection = null)

Get a list of content languages.
Parameters
  • array $publishedStates Array with the content language published states. Empty array for all.
  • bool $checkInstalled Check if the content language is installed.
  • string $pivot The pivot of the returning array.
  • string $orderField Field to order the results.
  • string $orderDirection Direction to order the results.
Returns
  • array Array of the content languages.
Since
  • 3.7.0
Show source code of this method: getContentLanguages Source Code

public static array
(mixed $fileName, mixed $debug = false)

Parse strings from a language file.
Parameters
  • string $fileName The language ini file path.
  • bool $debug If set to true debug language ini file.
Returns
  • array The strings parsed.
Since
  • 3.9.0
Show source code of this method: parseIniFile Source Code

public static bool
(mixed $fileName, array $strings)

Save strings to a language file.
Parameters
  • string $fileName The language ini file path.
  • array $strings The array of strings.
Returns
  • bool True if saved, false otherwise.
Since
  • 3.7.0
Show source code of this method: saveToIniFile Source Code

public static bool
(mixed $lang, mixed $basePath = JPATH_BASE)

Checks if a language exists.
Parameters
  • string $lang Language to check.
  • string $basePath Optional path to check.
Returns
  • bool True if the language exists.
Since
  • 3.7.0
Show source code of this method: exists Source Code

public static mixed
(mixed $lang)

Returns an associative array holding the metadata.
Parameters
  • 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
Show source code of this method: getMetadata Source Code

public static array
(mixed $basePath = JPATH_BASE)

Returns a list of known languages for an area
Parameters
  • string $basePath The basepath to use
Returns
  • array key/value pair with the language file and real name.
Since
  • 3.7.0
Show source code of this method: getKnownLanguages Source Code

public static string
(mixed $basePath = JPATH_BASE, mixed $language = null)

Get the path to a language
Parameters
  • string $basePath The basepath to use.
  • string $language The language tag.
Returns
  • string language related path or null.
Since
  • 3.7.0
Show source code of this method: getLanguagePath Source Code

public static array
(mixed $dir = null)

Searches for language directories within a certain base dir.
Parameters
  • string $dir directory of files.
Returns
  • array Array holding the found languages as filename => real name pairs.
Since
  • 3.7.0
Show source code of this method: parseLanguageFiles Source Code

public static array
(mixed $path)

Parse XML file for language information.
Parameters
  • string $path Path to the XML files.
Returns
  • array Array holding the found metadata as a key => value pair.
Since
  • 3.7.0
-
  • \RuntimeException
Show source code of this method: parseXMLLanguageFile Source Code

Tags Summary

Since
1.5