forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 language => Topic started by: su_ict on May 15, 2007, 11:11:05 am

Title: Register.php - language specific text not correctly invoked
Post by: su_ict on May 15, 2007, 11:11:05 am
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.

Title: Re: Register.php - language specific text not correctly invoked
Post by: Joachim Müller 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
Title: Re: Register.php - language specific text not correctly invoked
Post by: su_ict 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.
Title: Re: Register.php - language specific text not correctly invoked
Post by: Joachim Müller on May 20, 2007, 07:53:55 pm
Just delete all files inside the lang folder except dutch.php and you should be fine.
Title: Re: Register.php - language specific text not correctly invoked
Post by: su_ict 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  ;)
Title: Re: Register.php - language specific text not correctly invoked
Post by: Tharkon 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.