Upgrading a plugin from Joomla 1.5 to 1.6
Language files, which worked in Joomla 1.5, don't seem to be working:
Here is how they are defined in the ini:
<languages folder="language">
<language tag="en-GB">en-GB.plg_content_AutoReadMore.sys.ini</language>
</languages>
The language file is located in administrator/language/en-GB
I have upgraded it to Joomla 1.6 format by adding double quotes around arguments etc. (Here is the full text: http://pastebin.com/DdTzKpnf)
Please can someone give me any pointers on where I'm going wrong here.
Related
I'm creating Joomla plugin (3.3 version) and I want to add some images to /images/ folder when installing plugin. Is there a way to add them trough manifest file, or I have to create installation file ?
You can definitely add them through the manifest file the same way you add images to components.
<files folder="site">
<folder>images</folder>
</files>
I made a very simple joomla 3.2 module, but i can not manage to install my language .ini and sys.ini files.
Part of my .xml file
<files>
<filename>mod_myModuleTitle.xml</filename>
<filename module="mod_myModuleTitle">mod_myModuleTitle.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<folder>lib</folder>
<folder>tmpl</folder>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.mod_myModuleTitle.ini></language>
<language tag="en-GB">en-GB/en-GB.mod_myModuleTitle.sys.ini></language>
<language tag="it-IT">it-IT/it-IT.mod_myModuleTitle.ini></language>
<language tag="it-IT">it-IT/it-IT.mod_myModuleTitle.sys.ini></language>
</languages>
the ini files are inside myModuleTitle/language/en-GB folder and myModuleTitle/language/it-IT folder
Trying installing I got:
Warning JInstaller: :Install: File does not exist path/to/my/local/web/server/tmp/mod_myModuleTitle/language/en-GB/en-GB.mod_myModuleTitle.ini
EDIT
SOLVED!!!
adding tag
<folder>language</folder>
and removing
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.mod_myModuleTitle.ini></language>
<language tag="en-GB">en-GB/en-GB.mod_myModuleTitle.sys.ini></language>
<language tag="it-IT">it-IT/it-IT.mod_myModuleTitle.ini></language>
<language tag="it-IT">it-IT/it-IT.mod_myModuleTitle.sys.ini></language>
</languages>
solved my problem, languages .ini files are installed and used correctly.
Glad you worked it out, for others looking at this question, the <language> element was deprecated in Joomla 1.6, the recommended approach since then has been for all language files (normal and system) to be stored with the extension.
You can read more about it in Language section of the Manfest files article on the Joomla Doc's site.
mod_modulo.xml file:
<?xml version="1.0" encoding="utf-8"?>
<install type="module" version="1.5.0">
<name>**EXTNAME**</name>
<description>**EXTDESCR**</description>
<files>
.
.
.
</files>
<languages>
<language tag="en-US">languages/en-US.mod_modulo.ini</language>
<language tag="es-ES">languages/es-ES.mod_modulo.ini</language>
</languages>
</install>
es-ES.mod_modulo.xml:
EXTNAME=Mi modulo
EXTDESCR=Descripcion de mi modulo va aqui
I am using Joomla!1.5 to develop modules because I think that newer versions of Joomla are compatible with older modules. Anyway, the question is: How can I set the values of name and description in mod_module.xml to the strings found in the corresponding language file ?
Joomla 1.5's component installation manifest definition includes a section for administrator interface language files:
...
<administration>
<languages folder="administrator/language/">
<language tag="en-GB">en-GB/en-GB.com_my.ini</language>
<language tag="es-ES">es-ES/es-ES.com_my.ini</language>
</languages>
</administration>
...
However, this specification does not work for modules in that version.
The Document type definition used by J1.5's manifest files is no longer served.
Thant's why I am not sure whether the failure to copy the language files to the admin section's folder is a bug or is done by design. Their removal during the uninstallation process indicated that it is indeed a bug.
Joomla! v1.5 module installation is performed by libraries/joomla/installer/adapters/module/php.
This file is not accessing this node during the installation, but is deleting it during uninstall it deletes it:
$this->parent->removeFiles($root->getElementByPath('administration/languages'), 1);
What can you do?
Legacy packages support in 2.5 and 3.x requires compromises. I would personally advise against it, as it cripples your design.
Therefoe, you can either write a Joomla! 2.5+ module, or you can try to hack your way around this, which would not be pretty. Modules don't event have installation scripts, so you cannot even copy the language files during the module installation process.
The first thing that comes to mind is copying the language files to the administrator folder the first time the controller is invoked.
All this should, hopefully, convince you (and anyone reading this post) to switch to the current Joomla! version.
Try this,
In your xml file
<languages>
<language tag="en-US">languages/en-US.mod_modulo.ini</language>
<language tag="es-ES">languages/es-ES.mod_modulo.ini</language>
</languages>
in your mod_modulo.ini file
EXTNAME="Mi modulo"
EXTDESCR="Descripcion de mi modulo va aqui"
in your default.php file have.
echo "Name :".JText::_('EXTNAME');
echo "Description:".JText::_('EXTDESCR');
Hope its help you..
What is the difference between the usage of the install.sql file specified in extension manifest files on Joomla 1.5 and 1.6.
In 1.5, if you use method="upgrade" and the component is already installed, install.sql DOES get executed.
In 2.5, if you use method="upgrade" and the component is already installed, install.sql DOES NOT get executed.
Does anyone know if this change was intentional?
It is deliberate as from 1.6 up there is now a update tag for sql:
//executed when component is installed for the first time
<install folder="admin">
<sql>
<file driver="mysql" charset="utf8">sql/example.install.sql</file>
</sql>
</install>
//executed when component is uninstalled
<uninstall folder="admin">
<sql>
<file driver="mysql" charset="utf8">sql/example.uninstall.sql</file>
</sql>
</uninstall>
//executed when the component is installed over an existing version
//or updated through the Joomla Update Manager
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
See the Joomla 1.6 wikipage on the manifest.xml structure here for more information on this
I try to create a very simple module in Joomla. While my whole code is correct, and the module working properly, I cannot make it support the I18n feature.
More specific, my module directory is like that:
mod_mymodname:
languages:
en-GB.mod_mymodname.ini
mod_mymodname.php
mod_mymodname.xml
and then in my mod_mymodname.xml I have that code :
<?xml version="1.1" encoding="utf-8"?>
<extension type="module" version="2.5.0" client="site">
<name>MyModName</name>
... Other Options ...
<files>
<filename module="mod_mymodname">mod_mymodname.php</filename>
<filename>mod_mymodname.xml</filename>
</files>
<languages folder="languages">
<language tag="en-GB">en-GB.mod_mod_mymodname.ini</language>
</languages>
<config>
<fields name="params">
<fieldset name="basic">
<field name="modid" size="50" type="text" label="MODID" description="Description here" />
</fieldset>
</fields>
</config>
</extensions>
and my en-GB.mod_mymodname.ini has that content in it
MODID=Module ID
The problem is that in my admin section the field label has the value of "MODID" instead of "Module ID"
Is there anything wrong with that ? Is my first Joomla module, and I am not sure if everything is correct.
Note : The module doesn't require any translation in the front-end. I only need I18n for the administration section.
make sure you mentioned correct text for MODID in language file.
en-GB.mod_mymodname.ini ---> This file was used for declaring the text what we given in that module
Just add the following line in en-GB.mod_mymodname.ini this language file.
MODID="Module ID"
Save and check the module.. Hope this will work....
language file need to be in joomla language folder. If you had installed the module from admin then check the language folder and check if your file exists there.
check in administrator/languages/en-GB/
also you may have to change the way you have mentioned language files in your xml.
Have a look at this link for more detailed description
http://docs.joomla.org/Specification_of_language_files#Language_file_naming_conventions_and_precedence
Make sure you also have en-GB.mod_mymodname.sys.ini for translating text coming from the xml.
I thought of something else too. There does seem to be a known issue where for certain strings from the xml are only translated when the language file is in the main language folder rather than the extension language folder. So I usually put copies both places even though it's considered bad practice to put extension files in the core folder.
first add your module.xml language tag
<languages folder="languages">
<language tag="fr-FR">fr-FR.mod_mod_mymodname.ini</language>
<language tag="fr-FR">fr-FR.mod_mod_mymodname.sys.ini</language>
</languages>
then create two new file in your module language folder
fr-FR.mod_mod_mymodname.ini
fr-FR.mod_mod_mymodname.sys.ini
add the text you want to translate in .ini file like
MOD_MYMODULE_USERNAME="this is my mod"
Then add this constant value to your module default.php file like
JText::_ ('MOD_MYMODULE_USERNAME')