View/Helper/TableHelper.php
protected function _replaceTranslate($str) {
		// [__]Text to translate[/__]
		if (preg_match_all('/\[__\](.*?)\[\/__\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[1][$i]), $str);
			}
		}

		// [__d|domain]Text to translate[/__d]
		if (preg_match_all('/\[__d\|(.+?)\](.*?)\[\/__d\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[2][$i], null, $matches[1][$i]), $str);
			}
		}

		// [__c|category]Text to translate[/__c]
		if (preg_match_all('/\[__c\|(.+?)\](.*?)\[\/__c\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[2][$i], null, null, $matches[1][$i]), $str);
			}
		}

		return $str;
	}
protected function _replaceTranslate($str) {
		// [__]Text to translate[/__]
		if (preg_match_all('/\[__\](.*?)\[\/__\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[1][$i]), $str);
			}
		}

		// [__d|domain]Text to translate[/__d]
		if (preg_match_all('/\[__d\|(.+?)\](.*?)\[\/__d\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[2][$i], null, $matches[1][$i]), $str);
			}
		}

		// [__c|category]Text to translate[/__c]
		if (preg_match_all('/\[__c\|(.+?)\](.*?)\[\/__c\]/i', $str, $matches)) {
			foreach ($matches[0] as $i => $find) {
				$str = str_replace($find, I18n::translate($matches[2][$i], null, null, $matches[1][$i]), $str);
			}
		}

		return $str;
	}
protected function _replaceTranslate ( $ str ) { // [__]Text to translate[/__] if ( preg_match_all ( '/\[__\](.*?)\[\/__\]/i' , $ str , $ matches ) ) { foreach ( $ matches [ 0 ] as $ i => $ find ) { $ str = str_replace ( $ find , I18n :: translate ( $ matches [ 1 ] [ $ i ] ) , $ str ) ; } } // [__d|domain]Text to translate[/__d] if ( preg_match_all ( '/\[__d\|(.+?)\](.*?)\[\/__d\]/i' , $ str , $ matches ) ) { foreach ( $ matches [ 0 ] as $ i => $ find ) { $ str = str_replace ( $ find , I18n :: translate ( $ matches [ 2 ] [ $ i ] , null , $ matches [ 1 ] [ $ i ] ) , $ str ) ; } } // [__c|category]Text to translate[/__c] if ( preg_match_all ( '/\[__c\|(.+?)\](.*?)\[\/__c\]/i' , $ str , $ matches ) ) { foreach ( $ matches [ 0 ] as $ i => $ find ) { $ str = str_replace ( $ find , I18n :: translate ( $ matches [ 2 ] [ $ i ] , null , null , $ matches [ 1 ] [ $ i ] ) , $ str ) ; } } return $ str ; }
Replace translatable strings by their translated values.

Examples:
- [__]Translate this[/__]
- [__d|domain]Translate this[/__d]
- [__c|category]Translate this[/__c]

@param string $str String to check and modify.
@return string Modified string.
Replace translatable strings by their translated values .