From f44171243c71c52bff6b733cb501a604a64dc4da Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 2 May 2003 01:06:33 +0000 Subject: [PATCH] fix for phrase which end (after truncating to 230 chars) in a space (which has been striped by the db) --- phpgwapi/inc/class.translation_sql.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.translation_sql.inc.php b/phpgwapi/inc/class.translation_sql.inc.php index 9dc42ed334..9f9706860b 100644 --- a/phpgwapi/inc/class.translation_sql.inc.php +++ b/phpgwapi/inc/class.translation_sql.inc.php @@ -100,8 +100,8 @@ @function translate @abstract Return the translated string from $this->lang, if it exists. If no translation exists, return the same string with an asterisk. @discussion This should be called from the global function lang(), not directly. - @syntax translate('translate x',array('replacement')); OR translate('translate this'); - @example translate('translate this x', array('lang entry')); returns 'Translate this Lang Entry' or 'translate this lang x*' + @syntax translate('translate %1',array('replacement')); OR translate('translate this'); + @example translate('translate this %1', array('lang entry')); returns 'Translate this Lang Entry' or 'translate this lang %1*' */ function translate($key,$vars=False) { @@ -110,7 +110,7 @@ $vars = array(); } $ret = $key; - $_key = substr(strtolower($key),0,MAX_MESSAGE_ID_LENGTH); + $_key = trim(substr(strtolower($key),0,MAX_MESSAGE_ID_LENGTH)); if(!@isset($this->lang[$_key]) && !$this->loaded) {