Download the language file during the installation of the joomla plugin (2.5)

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 // no direct access
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>
<!-- ... author, copyright, version, .. --> 
<scriptfile>setupscripts.php</scriptfile>
<files>
    <filename plugin="myname">myname.php</filename>
    <filename>setupscripts.php</filename>
    <filename>index.html</filename>
    <folder>sql</folder>
</files>
<!-- ... install->sql->file ... -->
<!-- ... uninstall->sql->file ... -->
<!-- ... update->schemas->schemapath ... -->
<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>
   <!-- ... other languages ... -->
</languages>
<!-- ... config->fields->fieldset->field ... -->
</extension>

( folder = "admin" , , . ).

+2
2

, , . google Joomla dev .

, , . xml :

<!-- ... everything else stayed the same, except: -->
<files>
    <filename plugin="myplg">myplg.php</filename>
    <filename>index.html</filename>
    <folder>language</folder>
    <folder>sql</folder>
</files>
<languages folder="language">
        <language tag="en-GB">en-GB/en-GB.plg_system_myplg.ini</language>
        <language tag="en-GB">en-GB/en-GB.plg_system_myplg.sys.ini</language>
        <!-- .. other languages ... ->
</languages>
<!-- ... rest of the xml file ... -->

... , (///...), XML !

, , , ...

, , !

+1

, . , , . , .

+3

All Articles