fix for phrase which end (after truncating to 230 chars) in a space (which has been striped by the db)

This commit is contained in:
Ralf Becker 2003-05-02 01:06:33 +00:00
parent 7546857b3e
commit f44171243c

View File

@ -100,8 +100,8 @@
@function translate @function translate
@abstract Return the translated string from $this->lang, if it exists. If no translation exists, return the same string with an asterisk. @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. @discussion This should be called from the global function lang(), not directly.
@syntax translate('translate x',array('replacement')); OR translate('translate this'); @syntax translate('translate %1',array('replacement')); OR translate('translate this');
@example translate('translate this x', array('lang entry')); returns 'Translate this Lang Entry' or 'translate this lang x*' @example translate('translate this %1', array('lang entry')); returns 'Translate this Lang Entry' or 'translate this lang %1*'
*/ */
function translate($key,$vars=False) function translate($key,$vars=False)
{ {
@ -110,7 +110,7 @@
$vars = array(); $vars = array();
} }
$ret = $key; $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) if(!@isset($this->lang[$_key]) && !$this->loaded)
{ {