build/commands/TranslationsCommand.php
protected function highlightDiff($diff)
	{
		$lines = explode("\n", $diff);
		foreach ($lines as $key => $val) {
			if (mb_substr($val,0,1,'utf-8') === '@') {
				$lines[$key] = '<span class="info">'.CHtml::encode($val).'</span>';
			}
			else if (mb_substr($val,0,1,'utf-8') === '+') {
				$lines[$key] = '<ins>'.CHtml::encode($val).'</ins>';
			}
			else if (mb_substr($val,0,1,'utf-8') === '-') {
				$lines[$key] = '<del>'.CHtml::encode($val).'</del>';
			}
			else {
				$lines[$key] = CHtml::encode($val);
			}
		}

		return implode("\n", $lines);
	}
protected function highlightDiff($diff)
	{
		$lines = explode("\n", $diff);
		foreach ($lines as $key => $val) {
			if (mb_substr($val,0,1,'utf-8') === '@') {
				$lines[$key] = '<span class="info">'.CHtml::encode($val).'</span>';
			}
			else if (mb_substr($val,0,1,'utf-8') === '+') {
				$lines[$key] = '<ins>'.CHtml::encode($val).'</ins>';
			}
			else if (mb_substr($val,0,1,'utf-8') === '-') {
				$lines[$key] = '<del>'.CHtml::encode($val).'</del>';
			}
			else {
				$lines[$key] = CHtml::encode($val);
			}
		}

		return implode("\n", $lines);
	}
protected function highlightDiff ( $ diff ) { $ lines = explode ( "\n" , $ diff ) ; foreach ( $ lines as $ key => $ val ) { if ( mb_substr ( $ val , 0 , 1 , 'utf-8' ) === '@' ) { $ lines [ $ key ] = '<span class="info">' . CHtml :: encode ( $ val ) . '</span>' ; } else if ( mb_substr ( $ val , 0 , 1 , 'utf-8' ) === '+' ) { $ lines [ $ key ] = '<ins>' . CHtml :: encode ( $ val ) . '</ins>' ; } else if ( mb_substr ( $ val , 0 , 1 , 'utf-8' ) === '-' ) { $ lines [ $ key ] = '<del>' . CHtml :: encode ( $ val ) . '</del>' ; } else { $ lines [ $ key ] = CHtml :: encode ( $ val ) ; } } return implode ( "\n" , $ lines ) ; }
Adds all necessary HTML tags and classes to diff output

@param string $diff DIFF
@return string highlighted DIFF
Adds all necessary HTML tags and classes to diff output