Actions

API16

JInstallerComponent/loadLanguage

From Joomla! Documentation

< API16:JInstallerComponent
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Custom loadLanguage method

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

loadLanguage($path)
Parameter Name Default Value Description
$path $path the path where to find language files

Defined in

libraries/joomla/installer/adapters/component.php

Importing

jimport( 'joomla.installer.adapters.component' );

Source Body

public function loadLanguage($path)
{
        $this->manifest = &$this->parent->getManifest();
        $name = strtolower(JFilterInput::getInstance()->clean((string)$this->manifest->name, 'cmd'));
        $check = substr($name, 0, 4);
        if ($check="com_") {
        $name = substr($name, 4); }
        $extension = "com_$name";
        $lang =& JFactory::getLanguage();
        $source = $path;
        if($this->manifest->administration->files)
        {
                $element = $this->manifest->administration->files;
        }
        elseif ($this->manifest->files)
        {
                $element = $this->manifest->files;
        }
        else
        {
                $element = null;
        }
        if ($element)
        {
                $folder = (string)$element->attributes()->folder;
                if ($folder && file_exists("$path/$folder"))
                {
                        $source = "$path/$folder";
                }
        }
                $lang->load($extension . '.manage', $source, null, false, false)
        ||      $lang->load($extension, $source, null, false, false)
        ||      $lang->load($extension . '.manage', JPATH_ADMINISTRATOR, null, false, false)
        ||      $lang->load($extension, JPATH_ADMINISTRATOR, null, false, false)
        ||      $lang->load($extension . '.manage', $source, $lang->getDefault(), false, false)
        ||      $lang->load($extension, $source, $lang->getDefault(), false, false)
        ||      $lang->load($extension . '.manage', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false)
        ||      $lang->load($extension, JPATH_ADMINISTRATOR, $lang->getDefault(), false, false);
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />