Page 1 of 1

$lang['Submit_quiz']

Posted: Sun Nov 11, 2007 2:40 am
by ABTOP
You are using the same $lang['Submit_quiz'] for creating new quizzes and for answering existing ones. I wish you didn't do that since that creates certain translation difficulties.

OK, how about this?

Posted: Sun Nov 11, 2007 3:31 am
by ABTOP
In quiz.php find

Code: Select all

		$select_quiz_data = "SELECT * FROM " . QUIZ_TRUE_FALSE_TABLE . " WHERE quiz_id = $quiz_id";

			if(!$result_quiz_data = $db->sql_query($select_quiz_data))
			{
				message_die(GENERAL_ERROR, '', 'Could not obtain advanced quiz data', __LINE__, __FILE__);
			}
			
				while($quiz_data = $db->sql_fetchrow($result_quiz_data))
				{
				$quiz_question = smilies_pass(bbencode_second_pass($quiz_data['quiz_question'], ''));
				$quiz_question_id = $quiz_data['question_id'];
				$quiz_answer = $quiz_data['quiz_answer']; 
				
				 $template->assign_vars( array(
				 "U_QUIZ_NAME" => $quiz_name,		
				 "U_STATISTICS" => "<a href='" . append_sid("quiz_stats.$phpEx?" . POST_QUIZ_URL . "=$quiz_id") . "'>" . $lang['Quiz_stats'] . "</a>",
				 
				 "F_FORM" => append_sid("quiz.$phpEx?mode=results"),
				 "F_ID" => $quiz_id,
				 "F_TYPE" => $quiz_type,
				 "F_TIME" => time(),
	
				 "L_MOD_LANGS" => $mod_langs,	
				 "L_TRUE_FALSE_INFORMATION" => $lang['Quiz_true_false_information'], 
				 "L_TRUE" => $lang['Quiz_answer_true'], 
				 "L_FALSE" => $lang['Quiz_answer_false'],
				 "L_SUBMIT" => $lang['Submit_quiz']));
replace (line 485)
"L_SUBMIT" => $lang['Submit_quiz']));
with
"L_SUBMIT" => $lang['Submit_answers']));

in lang_quiz.ph find:
$lang['Submit_quiz'] = 'Submit Quiz';
after add:
$lang['Submit_answers'] = 'Submit Answers';

Posted: Mon Nov 12, 2007 5:46 am
by battye
Thanks for the suggestion. Why is it hard to translate though?

Submit Quiz makes sense for both submitting quizzes and answers, I thought it would save time by not adding an extra language variable?

Posted: Mon Nov 12, 2007 6:31 pm
by ABTOP
battye wrote:Thanks for the suggestion. Why is it hard to translate though?

Submit Quiz makes sense for both submitting quizzes and answers, I thought it would save time by not adding an extra language variable?
Actually, the buttons by themselves wouldn't be a problem. Although I still think there is a logical difference between "Submit ( questions for a new) Quiz" and "Submit Answers (for an existing Quiz)", I could have easily overcome those differences by translating the buttons into something generic like "Send".

The real problem arises from the third use of this language variable - for the layout link - the invitation to create a new quiz. That link would have to somehow be in imperative and carry the idea of creating something new (a quiz in this case). Those meanings would be very hard to reconcile with both buttons. I could only keep the sense together by finding appropriate translation for the link and the "Submit Quiz" button, but then I needed something different for the "Submit Answers" button.

Since you didn't put forward any technical objections to me adding a new language tag the way I wrote, I understand mine would be a functioning and acceptable way of doing it? I am only double-checking since my knowledge of php is quite limited.

Posted: Mon Nov 12, 2007 7:15 pm
by kikkotm
yeah..for Italian Lenguage is very Good..

Our Submit Quiz is: INSERISCI UN QUIZ
but is very different from: INVIA LE RISPOSTE (Submit Answers)

THANKS

Posted: Tue Nov 13, 2007 1:00 pm
by battye
ABTOP wrote:
battye wrote:Thanks for the suggestion. Why is it hard to translate though?

Submit Quiz makes sense for both submitting quizzes and answers, I thought it would save time by not adding an extra language variable?
Actually, the buttons by themselves wouldn't be a problem. Although I still think there is a logical difference between "Submit ( questions for a new) Quiz" and "Submit Answers (for an existing Quiz)", I could have easily overcome those differences by translating the buttons into something generic like "Send".

The real problem arises from the third use of this language variable - for the layout link - the invitation to create a new quiz. That link would have to somehow be in imperative and carry the idea of creating something new (a quiz in this case). Those meanings would be very hard to reconcile with both buttons. I could only keep the sense together by finding appropriate translation for the link and the "Submit Quiz" button, but then I needed something different for the "Submit Answers" button.

Since you didn't put forward any technical objections to me adding a new language tag the way I wrote, I understand mine would be a functioning and acceptable way of doing it? I am only double-checking since my knowledge of php is quite limited.
As far as the PHP goes, that is fine. Looks perfect infact.

Another thing you could do, to eliminate the need for adding to lang_quiz.php:

FIND (line 485 of quiz.php)

Code: Select all

"L_SUBMIT" => $lang['Submit_quiz']));
REPLACE WITH

Code: Select all

"L_SUBMIT" => $lang['Submit'])); 
And you could do this in several places. Wherever it says "Submit Quiz", you can make it $lang['Submit'] - which is simply "Submit" :)