From: mudrd8mz Date: Mon, 15 Jan 2007 11:18:26 +0000 (+0000) Subject: The maximum length of the missing strings to display can be set now. Fixes MDL-8184. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f024bea2796539604dae223ad77e3cebb65584bb;p=moodle.git The maximum length of the missing strings to display can be set now. Fixes MDL-8184. Because the tags
...
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. --- diff --git a/admin/lang.php b/admin/lang.php index f0a5314908..e1c8ae7d8b 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -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); @@ -199,6 +200,9 @@ $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\";
"; } }