Back to Language class

Method loadLanguage

protected bool
loadLanguage
(mixed $fileName, mixed $extension = 'unknown')
Loads a language file.
Parameters
  • string $fileName The name of the file.
  • string $extension The name of the extension.
Returns
  • bool True if new strings have been added to the language
Since
  • 1.7.0
-
  • \Joomla\CMS\Language\Language::load()
Class: Language
Project: Joomla

Method loadLanguage - Source code

/**
 * Loads a language file.
 *
 * This method will not note the successful loading of a file - use load() instead.
 *
 * @param   string  $fileName   The name of the file.
 * @param   string  $extension  The name of the extension.
 *
 * @return  boolean  True if new strings have been added to the language
 *
 * @see     Language::load()
 * @since   1.7.0
 */
protected function loadLanguage($fileName, $extension = 'unknown')
{
    $this->counter++;
    $result = false;
    $strings = $this->parse($fileName);
    if ($strings !== array()) {
        $this->strings = array_replace($this->strings, $strings, $this->override);
        $result = true;
    }
    // Record the result of loading the extension's file.
    if (!isset($this->paths[$extension])) {
        $this->paths[$extension] = array();
    }
    $this->paths[$extension][$fileName] = $result;
    return $result;
}