When I was checking the code, I found that line 520-525 contained hardcoded text strings:

<?php
    // format the availability info
    $output .= '<p>'. format_date($node->quiz_open) .' &mdash; '. format_date($node->quiz_close) .'</p>';
    $output .= '<p><strong>' . t('Days @quiz live for: ', array('@quiz' => QUIZ_NAME))  . '</strong> ' . floor(($node->quiz_close - $node->quiz_open) / 60 / 60 / 24) . '</p>';
    $remaining = floor(($node->quiz_close - time()) / 60 / 60 / 24);
    $remaining = ($remaining < 0)?'Expired':$remaining;
    $output .= '<p><strong>Days remaining:</strong> '. $remaining .'</p>';
    $elapsed = floor((time() - $node->quiz_open) / 60 / 60 / 24);
    $elapsed = ($elapsed < 0)?(-$elapsed) .' days to go':$elapsed;
    $output .= '<p><strong>Days since start:</strong> '. $elapsed .'</p>';
?>

My suggested fix:

<?php
    // format the availability info
    $output .= '<p>'. format_date($node->quiz_open) .' &mdash; '. format_date($node->quiz_close) .'</p>';
    $output .= '<p><strong>'. t('Days @quiz live for: ', array('@quiz' => QUIZ_NAME))  . '</strong> ' . floor(($node->quiz_close - $node->quiz_open) / 60 / 60 / 24) . '</p>';
    $remaining = floor(($node->quiz_close - time()) / 60 / 60 / 24);
    $remaining = ($remaining < 0) ? t('Expired') : $remaining;
    $output .= '<p><strong>'. t('Days remaining:') .'</strong> '. $remaining .'</p>';
    $elapsed = floor((time() - $node->quiz_open) / 60 / 60 / 24);
    $elapsed = ($elapsed < 0) ? (-$elapsed) . ' ' . t('days to go') . ' ' : $elapsed;
    $output .= '<p><strong>'. t('Days since start:') .'</strong> '. $elapsed .'</p>';
?>

Comments

mbutcher’s picture

What file is this from?

Can you please post this as a patch? I will certainly merge in a change like this.

Thanks!

Matt

kjarli’s picture

The file is quiz.module

mbutcher’s picture

Version: 5.x-1.1 » 6.x-3.x-dev
Status: Active » Fixed
Issue tags: +translation

This has been fixed in version 6.x-3.x. Thank you for the great catch.

Please, PLEASE report any missing translation features you find in quiz. Being a lazy English speaker, I do sometimes miss these, but it is very important to me that Quiz remains 100% translatable.

Thanks again for the patch.

Status: Fixed » Closed (fixed)
Issue tags: -translation

Automatically closed -- issue fixed for 2 weeks with no activity.