From f024bea2796539604dae223ad77e3cebb65584bb Mon Sep 17 00:00:00 2001 From: mudrd8mz Date: Mon, 15 Jan 2007 11:18:26 +0000 Subject: [PATCH] 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. --- admin/lang.php | 4 ++++ 1 file changed, 4 insertions(+) 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\";
"; } } -- 2.39.5