protected function _translateName( &$name, array $translations = array() )
	{
		$params = array();

		if( $this->_isFunction( $name, $params ) === true )
		{
			$transname = $name;
			if( isset( $translations[$name] ) ) {
				$transname = $translations[$name];
			}

			$find = array();
			$count = count( $params );

			for( $i = 0; $i < $count; $i++ ) {
				$find[$i] = '$' . ( $i + 1 );
			}

			return str_replace( $find, $params, $transname );
		}

		if( isset( $translations[$name] ) ) {
			return $translations[$name];
		} else {
			return $name;
		}
	}
protected function _translateName( &$name, array $translations = array() )
	{
		$params = array();

		if( $this->_isFunction( $name, $params ) === true )
		{
			$transname = $name;
			if( isset( $translations[$name] ) ) {
				$transname = $translations[$name];
			}

			$find = array();
			$count = count( $params );

			for( $i = 0; $i < $count; $i++ ) {
				$find[$i] = '$' . ( $i + 1 );
			}

			return str_replace( $find, $params, $transname );
		}

		if( isset( $translations[$name] ) ) {
			return $translations[$name];
		} else {
			return $name;
		}
	}
protected function _translateName ( & $ name , array $ translations = array ( ) ) { $ params = array ( ) ; if ( $ this -> _isFunction ( $ name , $ params ) === true ) { $ transname = $ name ; if ( isset ( $ translations [ $ name ] ) ) { $ transname = $ translations [ $ name ] ; } $ find = array ( ) ; $ count = count ( $ params ) ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ find [ $ i ] = '$' . ( $ i + 1 ) ; } return str_replace ( $ find , $ params , $ transname ) ; } if ( isset ( $ translations [ $ name ] ) ) { return $ translations [ $ name ] ; } else { return $ name ; } }
Translates an expression string and replaces the parameter if it's an expression function.

@param string $name Expresion string or function
@param array $translations Associative list of names and their translations
(may include parameter if a name is an expression function)
@return string Translated name (with replaced parameters if the name is an expression function)
Translates an expression string and replaces the parameter if it s an expression function .