src/Translation/LanguageBucket.php
/**
	 * Translates the provided text and replaces variables. If the text is not found in any language definition set,
	 * returns the provided text, with variables still replaced.
	 *
	 * @param string $text
	 * @param array $variables
	 */
Translates the provided text and replaces variables. If the text is not found in any language definition set,
returns the provided text, with variables still replaced.

@param string $text
@param array $variables
Translates the provided text and replaces variables . If the text is not found in any language definition set returns the provided text with variables still replaced . @param string $text @param array $variables
public function translate($text, $variables = array()) {
		$text = preg_replace("/({{\s*)([a-zA-Z._]+)(\s*}})/", "{{ $2 }}", $text);
		$match = $this->fastLookup($text);
		if (is_null($match)) {
			$match = $text;
		}
		if (!empty($variables)) {
			$match = $this->replaceVariables($match, $variables);
		}
		return $match;
	}
public function translate ( $ text , $ variables = array ( ) ) { $ text = preg_replace ( " /({{\s*)([a-zA-Z._]+)(\s*}})/ " , " {{ $2 }} " , $ text ) ; $ match = $ this -> fastLookup ( $ text ) ; if ( is_null ( $ match ) ) { $ match = $ text ; } if ( ! empty ( $ variables ) ) { $ match = $ this -> replaceVariables ( $ match , $ variables ) ; } return $ match ; }
Translates the provided text and replaces variables.
Translates the provided text and replaces variables .