[#5833] translation for plug_cbreconfirmemail_4.0.0 does not work

8 years 1 month ago - 8 years 1 month ago #278925 by erichburkhard
I have installed the newest CB version / the newest Joomla version and the plugin: plug_cbreconfirmemail_4.0.0 . But if the user changes his email address, the messages sent to him are not dependent on the Website language but always in english although both translations are available:

in the file:
/components/com_comprofiler/plugin/language/de-de/cbplugin/cbreconfirmemail-language.php

...the following text:
'THE_EMAIL_ADDRESS_ATTACHED_TO_YOUR_ACCOUNT_USERNAM_5c3f69' => 'Die E-Mailadresse zum angegebenen Konto [username] wurde geändert zu [new_email] und erfordert eine Bestätigung.<br><br>Die E-Mailadresse kann bestätigt werden durch Klicken auf den folgenden Link:<br><a href="[reconfirm]">[reconfirm]</a><br><br>Wurde dies fälschlicherweise getan, bitte die Administration kontaktieren oder Abbrechen durch <a href="[cancel]">Hier klicken</a>.',

in the file:
/components/com_comprofiler/plugin/language/en-gb/cbplugin/cbreconfirmemail-language.php

...the following text:
'THE_EMAIL_ADDRESS_ATTACHED_TO_YOUR_ACCOUNT_USERNAM_5c3f69' => 'The email address attached to your account [username] has changed to [new_email] and requires confirmation.<br><br>You can confirm your email address by clicking on the following link:<br><a href="[reconfirm]">[reconfirm]</a><br><br>If this was done in error please contact administration or cancel by <a href="[cancel]">clicking here</a>.',

...is this a bug?

Please Log in to join the conversation.

8 years 1 month ago #278952 by krileon
The translation is done before the message is sent to sendFromSystem, which is why it's not translating based off the recipient users language. Have added a bug ticket to look into changing when the translation is done to allow language switching or to directly implement language switching into CB Reconfirm Email. You can try the below quickfix to see if it'll help.

IN: components/com_comprofiler/plugin/user/plug_cbreconfirmemail/cbreconfirmemail.php
ON: Lines 173 - 174
FROM:
				$mailSubject				=	Get::clean( $cbUser->replaceUserVars( $this->params->get( 'reconfirm_subject', 'Your email address has changed' ), true, false, $extra ), GetterInterface::STRING );
				$mailBody					=	Get::clean( $cbUser->replaceUserVars( $this->params->get( 'reconfirm_body', 'The email address attached to your account [username] has changed to [new_email] and requires confirmation.<br><br>You can confirm your email address by clicking on the following link:<br><a href="[reconfirm]">[reconfirm]</a><br><br>If this was done in error please contact administration or cancel by <a href="[cancel]">clicking here</a>.' ), false, false, $extra ), GetterInterface::HTML );
TO:
				$mailSubject				=	Get::clean( $cbUser->replaceUserVars( $this->params->get( 'reconfirm_subject', 'Your email address has changed' ), true, false, $extra, false ), GetterInterface::STRING );
				$mailBody					=	Get::clean( $cbUser->replaceUserVars( $this->params->get( 'reconfirm_body', 'The email address attached to your account [username] has changed to [new_email] and requires confirmation.<br><br>You can confirm your email address by clicking on the following link:<br><a href="[reconfirm]">[reconfirm]</a><br><br>If this was done in error please contact administration or cancel by <a href="[cancel]">clicking here</a>.' ), false, false, $extra, false ), GetterInterface::HTML );

Basically just adding ", false" after $extra in those 2 variables replaceUserVars usage to turn off their CBTxt parsing of the string. This will let cbNotification do it instead.

forge.joomlapolis.com/issues/5833


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.290 seconds

Facebook Twitter LinkedIn