]> git.mjollnir.org Git - moodle.git/commitdiff
The maximum length of the missing strings to display can be set now. Fixes MDL-8184.
authormudrd8mz <mudrd8mz>
Mon, 15 Jan 2007 11:18:26 +0000 (11:18 +0000)
committermudrd8mz <mudrd8mz>
Mon, 15 Jan 2007 11:18:26 +0000 (11:18 +0000)
Because the tags <pre>...</pre> are used when displaying original English
version of missing texts, the screen may get very wide. This patch displays
only first 60 characters followed by '...'. This produces better output.

admin/lang.php

index f0a5314908b275aedc3c936206b4ab8e53a7d689..e1c8ae7d8be5cf2a13054e749f60ac5c582ac851 100644 (file)
@@ -46,6 +46,7 @@
     define('LANG_DEFAULT_FILE', '');            // default file to translate. Empty allowed
     define('LANG_LINK_MISSING_STRINGS', 1);     // create links from "missing" page to "compare" page?
     define('LANG_DEFAULT_USELOCAL', 0);         // should *_utf8_local be used by default?
+    define('LANG_MISSING_TEXT_MAX_LEN', 60);    // maximum length of the missing text to display
 
     $mode        = optional_param('mode', '', PARAM_ALPHA);
     $currentfile = optional_param('currentfile', LANG_DEFAULT_FILE, PARAM_FILE);
                         $missinglinkstart = '';
                         $missinglinkend = '';
                     }
+                    if (strlen($value) > LANG_MISSING_TEXT_MAX_LEN) {
+                        $value = substr($value, 0, LANG_MISSING_TEXT_MAX_LEN) . ' ...';
+                    }
                     $o .= "$"."string['".$missinglinkstart.$key.$missinglinkend."'] = \"$value\";<br />";
                 }
             }