Hi Tuan,
Thanks for your response.
Anyway, since your response didn't come on time, I had to dig around to find a way around the issue.
So, here is my solution in case anyone is interested in it for any reason.
1) Created a language folder and files under my payment plugin folder thus:
Code:
os_paymentpluginname (folder)
-os_paymentpluginname.php (file)
-os_paymentpluginname.xml (file)
-paymentpluginname (folder)
--language (folder)
---en-GB (folder)
----en-GB.paymentpluginname.ini (english language file)
---fr-FR (folder)
----fr-FR.paymentpluginname.ini (french language file)
...
2) Include the language containing folder,
paymentpluginname, in my plugin XML file thus:
Code:
...
<files>
<filename>os_paymentpluginname.php</filename>
<folder>paymentpluginname</folder>
</files>
...
3) Load language file manually from my plugin construct
Code:
public function __construct($params, $config = array())
{
// Load plugin language file
$lang = JFactory::getLanguage();
$lang_path = JPATH_SITE . '/components/com_osmembership/plugins/paymentpluginname';
$lang->load('paymentpluginname', $lang_path);
parent::__construct($params, $config);
...
4) Then I can use the language constant to get required text.
Code:
$text = JText::_("PLUGIN_LANGUAGE_CONSTANT_TEXT");
----
I needed this because my client is running a multilingual site and the payment plugin loads on the site (not redirected). So, I needed a way to translate plugin payment instructions to the active language.