Installing extension with language files via the .xml manifest
<files folder="frontend">
<folder>language</folder>
<folder>src</folder>
</files>
will copy the complete folder with all languages to your extension folder.
If you install a language later in Joomla, and that language is in your extension's /languge/ folder, then it will be available immediately.
This is what I always do.
<languages folder="language">
<language tag="en-GB">language/en-GB/plg_finder_content.ini</language>
</languages>
will copy the language file to Joomla's /language/en-GB/ where it will reside within all Joomla's language files (which are lot!).
However, if you install another language later in Joomla, then you'll have to reinstall your extension to install its language file.
I don't use this method because I like to keep my language files with my own extension (which is easier to manage).
Naming the language files
In the past the language files would include the language code, like
en-GB.pkg_extension.ini
Since Joomla 4 (possibly earlier with a Joomla 3) you can leave out the language code like
pkg_extension.ini
because its in the folder already. This is what I use.
So I recommend to only use <folder>language</folder> (and not use the <languages> tag)
and language files without the language code prefix, like pkg_extension.ini
<files folder="frontend">
<folder>language</folder>
<folder>src</folder>
</files>
will copy the complete folder with all languages to your extension folder.
If you install a language later in Joomla, and that language is in your extension's /languge/ folder, then it will be available immediately.
This is what I always do.
<languages folder="language">
<language tag="en-GB">language/en-GB/plg_finder_content.ini</language>
</languages>
will copy the language file to Joomla's /language/en-GB/ where it will reside within all Joomla's language files (which are lot!).
However, if you install another language later in Joomla, then you'll have to reinstall your extension to install its language file.
I don't use this method because I like to keep my language files with my own extension (which is easier to manage).
Naming the language files
In the past the language files would include the language code, like
en-GB.pkg_extension.ini
Since Joomla 4 (possibly earlier with a Joomla 3) you can leave out the language code like
pkg_extension.ini
because its in the folder already. This is what I use.
So I recommend to only use <folder>language</folder> (and not use the <languages> tag)
and language files without the language code prefix, like pkg_extension.ini
Statistics: Posted by pe7er — Sat Oct 26, 2024 10:04 am