It is very difficult for me to show a localized string during the installation of the system plugin (in Joomla 2.5). The "normal" way with localized strings in an XML file does not seem to work (see This other question: Description of the installation based on the language ).
Now I tried the method suggested there to show the description through installation scripts. This type of work (I can successfully echo the text), but I also canβt localize it - when debugging the language, it shows that plugin.sys.ini is not loaded yet; I tried to manually download the file, but was unsuccessful in downloading any of my plugin language files. This is what I got so far (in a file called setupscripts.php):
<?php
defined('_JEXEC') or die('Restricted access');
class plgsystemmyplgnameInstallerScript {
static function loadLanguage() {
$lang =& JFactory::getLanguage();
$lang->load('plg_system_myname', JPATH_ADMINISTRATOR);
}
function install($parent)
{
self::loadLanguage();
echo JTEXT::_("PLG_MYNAME_TEST_TEXT");
}
function uninstall($parent)
{
self::loadLanguage();
echo JText::_('PLG_MYNAME_UNINSTALL_TEXT');
}
function update($parent)
{
self::loadLanguage();
echo JText::_('PLG_MYNAME_UPDATE_TEXT');
}
function preflight($type, $parent) {}
function postflight($type, $parent) {
self::loadLanguage();
echo JText::_('PLG_MYNAME_INSTALL_TEXT');
}
}
PLG_MYNAME_TEST_TEXT???? PLG_MYNAME_INSTALL_TEXT?? ( ) ... , " " "" ( , , ???).
( .sys , , .sys.ini ( ), - , ( , , ? Joomla?). ( "" ".
- , ?
- ? ? , , ? xml :
<extension version="2.5" type="plugin" group="system" method="upgrade">
<name>PLG_MYNAME</name>
<scriptfile>setupscripts.php</scriptfile>
<files>
<filename plugin="myname">myname.php</filename>
<filename>setupscripts.php</filename>
<filename>index.html</filename>
<folder>sql</folder>
</files>
<languages [folder="admin"]>
<language tag="en-GB">en-GB.plg_system_myname.ini</language>
<language tag="en-GB">en-GB.plg_system_myname.sys.ini</language>
</languages>
</extension>
( folder = "admin" , , . ).