src/Translation.php
public function translate($key, $defaultValue = '', $locale = null) {
		if ($locale === null) {
			$locale = $this->getlocale();
		}

		if (isset($this->translations[$locale][$key])) {
			return $this->translations[$locale][$key];
		}

		return $defaultValue;
	}
public function translate($key, $defaultValue = '', $locale = null) {
		if ($locale === null) {
			$locale = $this->getlocale();
		}

		if (isset($this->translations[$locale][$key])) {
			return $this->translations[$locale][$key];
		}

		return $defaultValue;
	}
public function translate ( $ key , $ defaultValue = '' , $ locale = null ) { if ( $ locale === null ) { $ locale = $ this -> getlocale ( ) ; } if ( isset ( $ this -> translations [ $ locale ] [ $ key ] ) ) { return $ this -> translations [ $ locale ] [ $ key ] ; } return $ defaultValue ; }
Translate an identifier to specific value.

@param string $key Translation identifier.
@param string $defaultValue Optional.
@param string $locale Optional. Specify the locale of translation result.
@return string
Translate an identifier to specific value .