The original code do not use the $language_tag in $lang->load(); - by adding the $language_tag one should be able to change the language.
Code: Select all
$lang->load('plg_emailalerts_' . $this->_name, JPATH_ADMINISTRATOR, $language_tag);
It doesn't matter if I create new JText varibles and override them with Language Override.
I use three plugins of JmailAlerts (jma_latestnews, jma_latest_post_kunena and jma_latestphoto). The titles of these three plugins to be presented in the MailAlert is generated by the following code:
Code: Select all
<?php echo JText::_($pluginParams->get('plugintitle')); ?>
The titles do not toggle between the languages for two of them (jma_latestnews and jma_latest_post_kunena), but does it for the third plugin (jma_latestphoto).
If I replace the code in jma_latestphoto with its language variable (<?php //echo JText::_("PLG_JMA_LP_JS_TRANSLATABLE_TITLE"); ?>), then the language does not change either for its title when changing the language of $language_tag.
Other JText language variables do change when one change the language of $language_tag. The following JText language variable do change the language when one change the language of $language_tag.
Code: Select all
<?php echo JText::_("JMA_KUNENA_DATE_CREATED"); ?>