]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13997 Correct linking between missing mode and compare mode.
authormudrd8mz <mudrd8mz>
Sun, 6 Apr 2008 19:39:21 +0000 (19:39 +0000)
committermudrd8mz <mudrd8mz>
Sun, 6 Apr 2008 19:39:21 +0000 (19:39 +0000)
admin/lang.php

index ebec49bbbeec58ac54b1da96f0a1500b06e2d729..582b0ac136d34089c0b7840637eb1fc7701c748b 100644 (file)
                         $missingcounter++;
                         $totalcounter->missing++;
                     }
-                    if (LANG_LINK_MISSING_STRINGS && $missingstring) {
+                    if ($translationsdiffer) {
+                        $missingcounter++;
+                    }
+                    if (LANG_LINK_MISSING_STRINGS && ($missingstring || $translationsdiffer)) {
                         $missinglinkstart = "<a href=\"lang.php?mode=compare&amp;currentfile=$filename#missing$missingcounter\">";
                         $missinglinkend = '</a>';
                     } else {
                     $value2 = lang_fix_value_from_file($localstring[$key]);
                 }
                 error_reporting($CFG->debug);
-
-                // Color highlighting:
-                // red #ef6868 - translation missing in both system and local pack
-                // yellow #feff7f - translation missing in system pack but is translated in local
-                // green #AAFFAA - translation present in both system and local but is different
+                $missingtarget = '';
+                $missingnext = '';
+                $missingprev = '';
+                $cellcolour = '';
+                $usetabindex = false;
                 if (!$value) {
+                    // the string is not present in the pack being processed
                     if (!$value2) {
                         $cellcolour = 'class="bothmissing"';
                         $usetabindex = true;
                         '<img src="' . $CFG->pixpath . '/t/down.gif" class="iconsmall" alt="'.$strnext.'" /></a>';
                         $missingprev = '<a href="#missing'.($missingcounter-1).'">'.
                         '<img src="' . $CFG->pixpath . '/t/up.gif" class="iconsmall" alt="'.$strprev.'" /></a>';
-                    } else {
-                        $missingtarget = '';
-                        $missingnext = '';
-                        $missingprev = '';
                     }
                 } else {
-                    if ($value <> $value2 && $value2 <> '') {
+                    // the string is translated in the pack being processed
+                    if ($value <> $value2 && ($uselocal || $value2 <> '')) {
                         $cellcolour = 'class="localdifferent"';
                         $usetabindex = true;
-                    } else {
-                        $cellcolour = '';
-                        $usetabindex = false;
+                        $missingcounter++;
+                        if (LANG_DISPLAY_MISSING_LINKS) {
+                            $missingtarget = '<a name="missing'.$missingcounter.'"></a>';
+                            $missingnext = '<a href="#missing'.($missingcounter+1).'">'.
+                            '<img src="' . $CFG->pixpath . '/t/down.gif" class="iconsmall" alt="'.$strnext.'" /></a>';
+                            $missingprev = '<a href="#missing'.($missingcounter-1).'">'.
+                            '<img src="' . $CFG->pixpath . '/t/up.gif" class="iconsmall" alt="'.$strprev.'" /></a>';
+                        }
                     }
-                    $missingtarget = '';
-                    $missingnext = '';
-                    $missingprev = '';
                 }
 
                 if ($editable) {