english/libraries/joomla/language/language.php
/**
	 * Translate function, mimics the php gettext (alias _) function.
	 *
	 * The function checks if $jsSafe is true, then if $interpretBackslashes is true.
	 *
	 * @param   string  $string                The string to translate
	 * @param   bool    $jsSafe                Make the result javascript safe
	 * @param   bool    $interpretBackslashes  Interpret \t and \n
	 *
	 * @return  string  The translation of the string
	 *
	 * @since   11.1
	 */
Translate function, mimics the php gettext (alias _) function.
The function checks if $jsSafe is true, then if $interpretBackslashes is true.

@param   string  $string                The string to translate
@param   bool    $jsSafe                Make the result javascript safe
@param   bool    $interpretBackslashes  Interpret \t and \n

@return  string  The translation of the string


Translate function mimics the php gettext ( alias _ ) function . The function checks if $jsSafe is true then if $interpretBackslashes is true . @param string $string The string to translate @param bool $jsSafe Make the result javascript safe @param bool $interpretBackslashes Interpret \ t and \ n @return string The translation of the string
public function _($string, $jsSafe = false, $interpretBackSlashes = true)
	{
		$key = strtoupper($string);
		if (isset ($this->strings[$key])) {
			$string = $this->debug ? '**'.$this->strings[$key].'**' : $this->strings[$key];
			if ($this->debug) {
				$caller = $this->getCallerInfo();
				if (! array_key_exists($key, $this->used)) {
					$this->used[$key] = array();
				}
				$this->used[$key][] = $caller;
			}
		}
		else {
			if ($this->debug) {
				$caller = $this->getCallerInfo();
				$caller['string'] = $string;
				if (! array_key_exists($key, $this->orphans)) {
					$this->orphans[$key] = array();
				}
				$this->orphans[$key][] = $caller;
				$string = '??'.$string.'??';
			}
		}
		if ($jsSafe) {
			$string = addslashes($string);
		}
		else if ($interpretBackSlashes) {
			$string = str_replace(array('\\\\','\t','\n'),array("\\", "\t","\n"),$string);
		}
		return $string;
	}
public function _ ( $ string , $ jsSafe = false , $ interpretBackSlashes = true ) { $ key = strtoupper ( $ string ) ; if ( isset ( $ this -> strings [ $ key ] ) ) { $ string = $ this -> debug ? '**' . $ this -> strings [ $ key ] . '**' : $ this -> strings [ $ key ] ; if ( $ this -> debug ) { $ caller = $ this -> getCallerInfo ( ) ; if ( ! array_key_exists ( $ key , $ this -> used ) ) { $ this -> used [ $ key ] = array ( ) ; } $ this -> used [ $ key ] [ ] = $ caller ; } } else { if ( $ this -> debug ) { $ caller = $ this -> getCallerInfo ( ) ; $ caller [ 'string' ] = $ string ; if ( ! array_key_exists ( $ key , $ this -> orphans ) ) { $ this -> orphans [ $ key ] = array ( ) ; } $ this -> orphans [ $ key ] [ ] = $ caller ; $ string = '??' . $ string . '??' ; } } if ( $ jsSafe ) { $ string = addslashes ( $ string ) ; } else if ( $ interpretBackSlashes ) { $ string = str_replace ( array ( '\\\\' , '\t' , '\n' ) , array ( " \\ " , " \t " , " \n " ) , $ string ) ; } return $ string ; }
Translate function, mimics the php gettext (alias _) function.
Translate function mimics the php gettext ( alias _ ) function .
// Store debug information // Javascript filter // Interpret \n and \t characters