From d170223b2c1d92771a6bb6dcd2eac07bb2ad777c Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Mon, 14 Jan 2013 18:35:59 -0800 Subject: BUGIFX: added some set_language functions, fixed some strings for translation, fixed typo --- include/functions.php | 13 +++++++------ include/game.php | 3 ++- include/reminder.php | 3 ++- include/user.php | 2 ++ 4 files changed, 13 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 31f918c..d7ff065 100644 --- a/include/functions.php +++ b/include/functions.php @@ -122,11 +122,8 @@ function mymail($uid,$gameid=0,$type,$message) /* do we send the email right away or save it in the database? */ $send_now = 1; - $name = DB_get_name('userid',$user); - $header = sprintf(_('Hello %s'),$name); - $header .= "\n\n"; - - $To = DB_get_email('userid',$user); + $name = DB_get_name('userid',$user); + $To = DB_get_email('userid',$user); /* check if user wants email right away or if we should save it in * the database for later delivery @@ -138,6 +135,9 @@ function mymail($uid,$gameid=0,$type,$message) /* use local language */ set_language($uidPREF['language']); + $header = sprintf(_('Hello %s'),$name); + $header .= "\n\n"; + /* add standard header and footer */ $subject = "$EmailName "; if($gameid) @@ -185,7 +185,7 @@ function mymail($uid,$gameid=0,$type,$message) } /* standard goodbye */ - $footer = "\n"._("Have a nice day\n your E-Doko service department"). + $footer = "\n"._('Have a nice day')."\n "._('your E-Doko service department'). "\n\n". "-- \n". _('You can change your mail delivery mode in the preference menu.'). @@ -201,6 +201,7 @@ function mymail($uid,$gameid=0,$type,$message) DB_digest_insert_email($To,$message,$type,$gameid); } } + /* reset language to original user*/ set_language($PREF['language']); diff --git a/include/game.php b/include/game.php index 9b878aa..6c6b12b 100644 --- a/include/game.php +++ b/include/game.php @@ -1698,7 +1698,7 @@ switch($mystatus) { set_language($userid,'uid'); $email_message = sprintf(_("A card has been played in game %s.\n\n". - "It's your turn now.\n". + "It's your turn now.\n". 'Use this link to play a card: '),DB_format_gameid($gameid)).$HOST.$INDEX.'?action=game&me='.$next_hash."\n\n" ; mymail($userid,$gameid, GAME_YOUR_TURN, $email_message); set_language($myid,'uid'); @@ -1942,6 +1942,7 @@ switch($mystatus) } $email_message .= "\n\n (use in-game comments to reach all players)\n\n"; mymail($userids,$gameid, GAME_OVER, $email_message); + set_language($myid,'uid'); } } else diff --git a/include/reminder.php b/include/reminder.php index e17a7bf..df437ad 100644 --- a/include/reminder.php +++ b/include/reminder.php @@ -18,7 +18,7 @@ * */ -/* make sure that we are not called from outside the scripts, +/* make sure that we are not called from outside the scripts, * use a variable defined in config.php to check this */ if(!isset($HOST)) @@ -42,6 +42,7 @@ if(!$myid) } DB_update_user_timestamp($myid); +set_language($myid,'uid'); /* get some information from the DB */ $gameid = DB_get_gameid_by_hash($me); diff --git a/include/user.php b/include/user.php index d85dac5..6169495 100644 --- a/include/user.php +++ b/include/user.php @@ -46,6 +46,8 @@ if(myisset('forgot')) if($ok) { + set_language($myid,'uid'); + /* check how many entries in recovery table */ $number = DB_get_number_of_passwords_recovery($myid); -- cgit v1.2.3-18-g5258