Difference between revisions of "JInstallerModule/loadLanguage"
From Joomla! Documentation
< API16:JInstallerModule
(New page: ===Description===
Custom loadLanguage method
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]...) |
m (removing red link to edit, no existant pages) |
||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 71: | Line 71: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
Line 86: | Line 86: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API16]] |
Revision as of 22:02, 13 May 2013
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Custom loadLanguage method
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
loadLanguage($path)
Parameter Name | Default Value | Description |
---|---|---|
$path | $path the path where to find language files |
Defined in[edit]
libraries/joomla/installer/adapters/module.php
Importing[edit]
jimport( 'joomla.installer.adapters.module' );
Source Body[edit]
public function loadLanguage($path)
{
$this->manifest = &$this->parent->getManifest();
if ($this->manifest->files)
{
$element = $this->manifest->files;
$extension = '';
if (count($element->children()))
{
foreach ($element->children() as $file)
{
if ((string)$file->attributes()->module)
{
$extension = strtolower((string)$file->attributes()->module);
break;
}
}
}
if ($extension)
{
$lang =& JFactory::getLanguage();
$source = $path;
$folder = (string)$element->attributes()->folder;
if ($folder && file_exists("$path/$folder"))
{
$source = "$path/$folder";
}
$client = (string)$this->manifest->attributes()->client;
$lang->load($extension . '.manage', $source, null, false, false)
|| $lang->load($extension, $source, null, false, false)
|| $lang->load($extension . '.manage', constant('JPATH_' . strtoupper($client)), null, false, false)
|| $lang->load($extension, constant('JPATH_' . strtoupper($client)), null, false, false)
|| $lang->load($extension . '.manage', $source, $lang->getDefault(), false, false)
|| $lang->load($extension, $source, $lang->getDefault(), false, false)
|| $lang->load($extension . '.manage', constant('JPATH_' . strtoupper($client)), $lang->getDefault(), false, false)
|| $lang->load($extension, constant('JPATH_' . strtoupper($client)), $lang->getDefault(), false, false);
}
}
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
<CodeExamplesForm />