Skip to Content Skip to Menu

Notification messages sent in wrong language

  • Theo01
  • Theo01
  • OFFLINE
  • Posts: 16
  • Thanks: 0
  • Karma: 0
14 years 3 months ago #139162 by Theo01
One of our users pointed out that our site behaves strange when it sends out notification emails following private messages.

We're using CB (latest release version) together with uddeIM (latest version).

User A has French as default language, user B has English as default language.

When user A sends a private message to user B, user B receives the notification emails in French. When user B sends a message to user A, user A receives this email in English.

So, basically, each user receives a notification email in a language that is not their default. It's in the language of the user sending the message instead of the one receiving it.

I searched the forum and couldn't find anything on that subject. I checked all possible settings in CB and uddeIM but couldn't see anything that sounds distantly related to that oddity.

Does anyone have an idea what could be wrong with our site?

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

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
14 years 3 months ago #139173 by slabbi
uddeIM uses the same language as defined in Joomla.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

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

  • Theo01
  • Theo01
  • OFFLINE
  • Posts: 16
  • Thanks: 0
  • Karma: 0
14 years 3 months ago #139218 by Theo01
slabbi wrote:

uddeIM uses the same language as defined in Joomla.

Yes, but isn't that wrong?

If someone uses Spanish to send a message to a user whose language is English, the recipient should receive the notification message in English (his/her language), not Spanish.

uddeIM uses the language the sender has visited/configured, which is not necessarily something the recipient can understand.

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

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
14 years 3 months ago #139230 by slabbi
No, not really. uddeIM has no possibilty to identify the language the receiver has configured. So it uses the default frontend language.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

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

  • Theo01
  • Theo01
  • OFFLINE
  • Posts: 16
  • Thanks: 0
  • Karma: 0
14 years 3 months ago #139257 by Theo01
Wouldn't something like that work?
This is untested, but I'll give it a go as soon as I find a place where to put it. :)

[code:1]
function uddeIMgetLanguageFromID ($id, $config) {
$user = &JFactory::getUser ($id);
$lang = &JFactory::getLanguage ();
$user_language = $user->getParam ('language', $lang->getDefault);
$user_lang = new JLanguage ($user_language);
$language = strtolower ($user_lang->getBackwardLang());
return $language;
}
[/code:1]

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

  • Theo01
  • Theo01
  • OFFLINE
  • Posts: 16
  • Thanks: 0
  • Karma: 0
14 years 3 months ago #139288 by Theo01
Yes, it works. I almost got it completed.
I'll come back as soon as I have it fully implemented.

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

Moderators: beatnantslabbikrileon
Powered by Kunena Forum