3
votes

This document says "Plugin language files are always installed in administrator/languages/xx-XX/....." However I tried including language files inside my plugin at plugins/content/plugin_test/language/en-GB/.... and inside my plugin_test.php file, I've added the following code:

function __construct(& $subject, $config) {
    $lang = JFactory::getLanguage();
    $lang->load('plg_content_plugin_test', dirname(__FILE__));
    parent::__construct($subject, $config);

}

This seems to work fine. I was wondering if this is a correct approach to include the language files or the language files must be placed inside the administrator folder as suggested in the docs?

1
This is absolutely fine to have the translation language files in your plugin folder.Laoneo

1 Answers

3
votes

Yes, in fact it's recommended.

That document was out of date, since Joomla 1.6 the recommended location has been for language files to be stored within the extension's directory. This is explained in the Language section of the Manifest Files article.

I've update the J3.2 Creating a content plugin article to reflect the Manifest Files article.