Actions

API15

JPlugin/loadLanguage

From Joomla! Documentation

< API15:JPlugin
Revision as of 17:17, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

Loads the plugin language file

[Edit Descripton]

Description:JPlugin/loadLanguage

Syntax

loadLanguage($extension= '', $basePath=JPATH_BASE)
Parameter Name Default Value Description
$extension $extension The extension for which a language file should be loaded
$basePath JPATH_BASE $basePath The basepath to use

Returns

boolean True, if the file has successfully loaded.

Defined in

libraries/joomla/plugin/plugin.php

Importing

jimport( 'joomla.plugin.plugin' );

Source Body

function loadLanguage($extension = '', $basePath = JPATH_BASE)
{
        if(empty($extension)) {
                $extension = 'plg_'.$this->_type.'_'.$this->_name;
        }
 
        $lang =& JFactory::getLanguage();
        return $lang->load( strtolower($extension), $basePath);
}

[Edit See Also] SeeAlso:JPlugin/loadLanguage

Examples

<CodeExamplesForm />