help to better help you:

Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!

German JEM with English Mails

German JEM with English Mails

4 years 7 months ago
#27395
In our JEM installation (2.3.0, german) under Joomla 3.9.20 (german) everything works fine except the Mails attendees get when register/unregister... to an event: --> All Mail texts are english

It's not a big problem but a minor flaw, but I would be grateful if anybody could give me a hint what to do.
(German language file in this ...plugin... directory exists)

Please Log in or Create an account to join the conversation.

Re: German JEM with English Mails

4 years 7 months ago - 4 years 7 months ago
#27397
Hi Sepp,

You're right: there is a problem with the mails being send by the plugin. It seems there is a little error in the germand language-string and besides that the language strings are not read from plugin folder. Guess they do from front, but it looks it's not from backend.


language string
File: /plugins/jem/mailer/language/de-DE/de-DE.plg_jem_mailer.ini
Find:
Code:
PLG_JEM_MAILER_LOG_SEND_ERROR="Fehler beim Senden einer Emails an "_QQ_"%s"_QQ_"

change it to
Code:
PLG_JEM_MAILER_LOG_SEND_ERROR="Fehler beim Senden einer Emails an "_QQ_"%s"_QQ_""
closing character was missing.


adjust plugin mailer file
But then you have to do something else.
Go to file: /plugins/jem/mailer/mailer.php

Find
Code:
/** * Constructor * * @param object &$subject The object to observe * @param array $config An array that holds the plugin configuration * */ public function __construct(& $subject, $config) { parent::__construct($subject, $config); $this->loadLanguage(); $app = JFactory::getApplication(); $jemsettings = JemHelper::globalattribs(); $this->_SiteName = $app->getCfg('sitename'); $this->_MailFrom = $app->getCfg('mailfrom'); $this->_FromName = $app->getCfg('fromname'); $this->_AdminDBList = $this->Adminlist(); $this->_UseLoginName = !$jemsettings->get('global_regname', 1); // regname == 1: name, 0: username (login name) }


change or add it to
Code:
/** * Constructor * * @param object &$subject The object to observe * @param array $config An array that holds the plugin configuration * */ public function __construct(& $subject, $config) { parent::__construct($subject, $config); $lang = JFactory::getLanguage(); $extension = 'plg_jem_mailer'; $base_dir = JPATH_SITE.'/plugins/jem/mailer/'; $language_tag = 'de-DE'; $reload = true; $lang->load($extension, $base_dir, $language_tag, $reload); $app = JFactory::getApplication(); $jemsettings = JemHelper::globalattribs(); $this->_SiteName = $app->getCfg('sitename'); $this->_MailFrom = $app->getCfg('mailfrom'); $this->_FromName = $app->getCfg('fromname'); $this->_AdminDBList = $this->Adminlist(); $this->_UseLoginName = !$jemsettings->get('global_regname', 1); // regname == 1: name, 0: username (login name) }

Thing is that the plugin wasn't looking for language files in plugin-folder from backend.


uhm am seeing i'm hardcoding the language tag but we can catch what language we're in..
Code:
$lang->getTag();


Extra note:
if you have a local version and want to test out sending mails locally then you can use a program like smtp4dev
github.com/rnwood/smtp4dev/releases/tag/v2.0.10
Last edit: 4 years 7 months ago by Bluefox.
The following user(s) said Thank You: hekla, sepp25

Please Log in or Create an account to join the conversation.

Re: German JEM with English Mails

4 years 7 months ago
#27399
That works ! Thx !
I did not understand the
uhm am seeing i'm hardcoding the language tag but we can catch what language we're in..
Code:
$lang->getTag();

would this be an alternative to these lines ?
Code:
$lang = JFactory::getLanguage(); $extension = 'plg_jem_mailer'; $base_dir = JPATH_SITE.'/plugins/jem/mailer/'; $language_tag = 'de-DE'; $reload = true; $lang->load($extension, $base_dir, $language_tag, $reload);

anyway: problem solved ! :-)

Please Log in or Create an account to join the conversation.

Re: German JEM with English Mails

4 years 7 months ago - 4 years 7 months ago
#27400
it's more a replacement of this line
Code:
$language_tag = 'de-DE';

There i did hardcode the language-Tag.
a replacement for that line can be:
Code:
$language_tag = $lang->getTag();
but if everything works fine at the moment i wouldn't bother it.
// have to note that i didn't test it out
Last edit: 4 years 7 months ago by Bluefox.
The following user(s) said Thank You: sepp25

Please Log in or Create an account to join the conversation.

Time to create page: 0.435 seconds