src/Translation/LanguageParser.php
/**
	 * Normalizes a line by trimming off whitespace and removing comments.
	 *
	 * @param string $text
	 * @return string
	 */
Normalizes a line by trimming off whitespace and removing comments.
@param string $text
@return string
Normalizes a line by trimming off whitespace and removing comments . @param string $text @return string
protected function normalizeLine($text) {
		preg_match('/(?s)(?:(?<!\\\\)\'(?:\\\\\'|[^\'])*\'|(?<!\\\\)"(?:\\\\"|[^"])*")(*SKIP)(*F)|#/', $text, $matches, PREG_OFFSET_CAPTURE);
		if (!empty($matches)) {
			$offset = $matches[0][1];
			$text = substr($text, 0, $offset);
		}
		$text = trim($text);
		return $text;
	}
protected function normalizeLine ( $ text ) { preg_match ( '/(?s)(?:(?<!\\\\)\'(?:\\\\\'|[^\'])*\'|(?<!\\\\)"(?:\\\\"|[^"])*")(*SKIP)(*F)|#/' , $ text , $ matches , PREG_OFFSET_CAPTURE ) ; if ( ! empty ( $ matches ) ) { $ offset = $ matches [ 0 ] [ 1 ] ; $ text = substr ( $ text , 0 , $ offset ) ; } $ text = trim ( $ text ) ; return $ text ; }
Normalizes a line by trimming off whitespace and removing comments.
Normalizes a line by trimming off whitespace and removing comments .
// Find a comment character outside of any quotes // Remove comments from the line // Trim the text