Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Register.php - language specific text not correctly invoked  (Read 12180 times)

0 Members and 1 Guest are viewing this topic.

su_ict

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22

Hi - i have a problem with language specific variables in a part of register.php .

See following lines in register.php :

Code: [Select]
if ($CONFIG['reg_notify_admin_email']) {

                        // get default language in which to inform the admin
                        $lang_register_php_def = cpg_get_default_lang_var('lang_register_php');
                        $lang_register_approve_email_def = cpg_get_default_lang_var('lang_register_approve_email');

$lang_register_php_def is then used in following lines :

Code: [Select]
   cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_request_email_subject'], $CONFIG['gallery_name']), nl2br(strtr($lang_register_approve_email_def, $template_vars)));
                                        } else {
                                                        cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_email_subject'], $CONFIG['gallery_name']), sprintf($lang_register_php_def['notify_admin_email_body'], $user_name));
                }

This does not result in inserting the correct language specific notify_admin_request_email_subject and notify_admin_email_body from my language file (dutch.php) - instead it switches to English.

I could not find a setting which specificies in which language the Administrator should be contacted - i assume it should be the language setting of the Coppermine Gallery used.

I modified register.php :

1. deleted the lines setting the *_def variables
2. just used the $lang_register_php instead - delivers correctly the dutch translation.

« Last Edit: May 25, 2007, 11:16:57 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Register.php - language specific text not correctly invoked
« Reply #1 on: May 15, 2007, 02:34:47 pm »

This is indeed a known issue: the emails being sent by Coppermine do not take into account the language preferences by particular users. This may result in emails being sent in a language that the end user doesn't use/understand. A fix is scheduled for future versions, but it's not that easy to accomplish, since user language preferences will have to be stored in the database, which will result in issues when bridging. I'm not sure about the workaround you suggested, but if this works for you, then fine.

Joachim
Logged

su_ict

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Register.php - language specific text not correctly invoked
« Reply #2 on: May 20, 2007, 06:24:53 pm »

Quote from: GauGau
This is indeed a known issue: the emails being sent by Coppermine do not take into account the language preferences by particular users. This may result in emails being sent in a language that the end user doesn't use/understand. A fix is scheduled for future versions, but it's not that easy to accomplish, since user language preferences will have to be stored in the database, which will result in issues when bridging.
Joachim
Thx Joachim, the particular section i am refering to is only used, at my site, for registering users into the gallery - since the default language of the gallery is set to Dutch by admin and all users are dutch(ies) i can live with the fact that the sentences used in email are translated to dutch - even more so = i want it to be this way so this workaround is ok by me.
Grtz.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Register.php - language specific text not correctly invoked
« Reply #3 on: May 20, 2007, 07:53:55 pm »

Just delete all files inside the lang folder except dutch.php and you should be fine.
Logged

su_ict

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Register.php - language specific text not correctly invoked
« Reply #4 on: May 25, 2007, 11:04:21 am »

Just delete all files inside the lang folder except dutch.php and you should be fine.

Yep - i know  8)
I just keep it as i stated before - suites my needs perfectly.

Feel free to set this to solved  ;)
Logged

Tharkon

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Register.php - language specific text not correctly invoked
« Reply #5 on: December 28, 2007, 04:28:11 am »

Hi,

I had a similar problem and just wanted to say that this worked for me.

I've also tested it with different languages, and it appears that this tweak will actually cause the "known issue".

Without this tweak all e-mails were in German, and with it they are in the language of the user.

But since like su_ict, I only use Dutch, this won't be a problem for me.
Logged
Pages: [1]   Go Up
 

Page created in 0.034 seconds with 19 queries.