Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

German JEM with English Mails 7 months 1 week ago #27395

  • sepp25
  • sepp25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 2
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.

German JEM with English Mails 7 months 1 week 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:
PLG_JEM_MAILER_LOG_SEND_ERROR="Fehler beim Senden einer Emails an "_QQ_"%s"_QQ_"

change it to
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
	/**
	 * 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
	/**
	 * 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..
$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
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3
The following user(s) said Thank You: hekla, sepp25

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

Last edit: by Bluefox.

German JEM with English Mails 7 months 1 week ago #27399

  • sepp25
  • sepp25's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 16
  • Thank you received: 2
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..

$lang->getTag();


would this be an alternative to these lines ?
$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.

German JEM with English Mails 7 months 1 week ago #27400

it's more a replacement of this line
$language_tag = 'de-DE';

There i did hardcode the language-Tag.
a replacement for that line can be:
$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
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3
The following user(s) said Thank You: sepp25

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

Last edit: by Bluefox.
  • Page:
  • 1
Time to create page: 0.306 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.

Follow us......