]> git.mjollnir.org Git - moodle.git/commitdiff
Produces better HTML/CSS output to fit into translators' screen.
authormudrd8mz <mudrd8mz>
Fri, 2 Feb 2007 14:42:15 +0000 (14:42 +0000)
committermudrd8mz <mudrd8mz>
Fri, 2 Feb 2007 14:42:15 +0000 (14:42 +0000)
There are only two columns in the translation table form now. Odd and even
rows' background alters.
See MDL-8334 and http://moodle.org/mod/forum/discuss.php?d=62800 for more info about this.

admin/lang.php

index ca9e9d666325604033138fd27f11f91f7a43ce8e..3da624d94708e988503995bbb44816d9bc07b5b7 100644 (file)
         }
         print_box_end();
 
+        print_heading("<a href=\"lang.php?mode=missing\">$strmissingstrings</a>", "center", 4); // one-click way back
 
         print_box_start();
         echo $strfilestoredin;
                 echo "<form id=\"$currentfile\" action=\"lang.php\" method=\"post\">";
                 echo '<div>';
             }
-            echo "<table summary=\"\" width=\"100%\" class=\"generalbox\">";
+            echo "<table summary=\"\" width=\"100%\" class=\"translator\">";
             $linescounter = 0;
             $missingcounter = 0;
             foreach ($enstring as $key => $envalue) {
                 $linescounter++ ;
                 if (LANG_SUBMIT_REPEAT &&  $editable && $linescounter % LANG_SUBMIT_REPEAT_EVERY == 0) {
-                    echo '<tr><td colspan="2">&nbsp;</td><td><br />';
+                    echo '<tr><td>&nbsp;</td><td><br />';
                     echo '    <input type="submit" name="update" value="'.get_string('savechanges').': '.$currentfile.'" />';
                     echo '<br />&nbsp;</td></tr>';
                 }
                 $envalue = str_replace("%%","%",$envalue);
                 $envalue = str_replace("\\","",$envalue);              // Delete all slashes
 
-                echo "\n\n".'<tr>';
-                echo '<td dir="ltr" lang="en">'.$key.'</td>'."\n";
-                echo '<td dir="ltr" lang="en">'.$envalue.'</td>'."\n";
+                echo "\n\n".'<tr class="';
+                if ($linescounter % 2 == 0) {
+                    echo 'r0';
+                } else {
+                    echo 'r1';
+                }
+                echo '">';
+                echo '<td dir="ltr" lang="en">';
+                echo '<span class="stren">'.$envalue.'</span>';
+                echo '<br />'."\n";
+                echo '<span class="strkey">'.$key.'</span>';
+                echo '</td>'."\n";
 
                 // Missing array keys are not bugs here but missing strings
                 error_reporting(E_ALL ^ E_NOTICE);
                 // green #AAFFAA - translation present in both system and local but is different
                 if (!$value) {
                     if (!$value2) {
-                        $cellcolour = 'style="background-color: #ef6868"'; // TODO: replace by CSS class
+                        $cellcolour = 'class="bothmissing"';
                     } else {
-                        $cellcolour = 'style="background-color: #feff7f"'; // TODO: replace by CSS class
+                        $cellcolour = 'class="mastermissing"';
                     }
                     $missingcounter++;
                     if (LANG_DISPLAY_MISSING_LINKS) {
                     }
                 } else {
                     if ($value <> $value2 && $value2 <> '') {
-                        $cellcolour = 'style="background-color: #AAFFAA"'; // TODO: replace by CSS class
+                        $cellcolour = 'class="localdifferent"';
                     } else {
                         $cellcolour = '';
                     }
                     } else {
                         $valuelen = strlen($envalue);
                     }
-                    $cols=50;
+                    $cols=40;
                     if (strstr($value, "\r") or strstr($value, "\n") or $valuelen > $cols) {
                         $rows = ceil($valuelen / $cols);
                         echo '<textarea name="stringXXX'.lang_form_string_key($key).'" cols="'.$cols.'" rows="'.$rows.'">'.$value.'</textarea>'."\n";
                 echo '</tr>'."\n";
             }
             if ($editable) {
-                echo '<tr><td colspan="2">&nbsp;</td><td><br />';
+                echo '<tr><td>&nbsp;</td><td><br />';
                 echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
                 echo '    <input type="hidden" name="currentfile" value="'.$currentfile.'" />';
                 echo '    <input type="hidden" name="mode" value="compare" />';