function _potx_marker_error in Translation template extractor 5
Same name and namespace in other branches
- 8 potx.inc \_potx_marker_error()
- 5.2 potx.inc \_potx_marker_error()
- 6.3 potx.inc \_potx_marker_error()
- 6 potx.inc \_potx_marker_error()
- 6.2 potx.inc \_potx_marker_error()
- 7.3 potx.inc \_potx_marker_error()
- 7 potx.inc \_potx_marker_error()
- 7.2 potx.inc \_potx_marker_error()
Output a marker error with an extract of where the error was found.
Parameters
$file: Name of file
$line: Line number of error
$marker: Function name with which the error was identified
$ti: Index on the token array
3 calls to _potx_marker_error()
- _potx_find_format_plural_calls in ./
potx.inc - Detect all occurances of format_plural calls.
- _potx_find_t_calls in ./
potx.inc - Detect all occurances of t()-like calls.
- _potx_find_watchdog_calls in ./
potx.inc - Detect all occurances of watchdog() calls. Only for Drupal 6.
File
- ./
potx.inc, line 544 - Extraction API used by the web and command line interface.
Code
function _potx_marker_error($file, $line, $marker, $ti) {
global $_potx_tokens;
$tokens = '';
$ti += 2;
$tc = count($_potx_tokens);
$par = 1;
while ($tc - $ti > 0 && $par) {
if (is_array($_potx_tokens[$ti])) {
$tokens .= $_potx_tokens[$ti][1];
}
else {
$tokens .= $_potx_tokens[$ti];
if ($_potx_tokens[$ti] == "(") {
$par++;
}
else {
if ($_potx_tokens[$ti] == ")") {
$par--;
}
}
}
$ti++;
}
_potx_status(t("Invalid marker content in %filename:%lineno\n* %marker(%tokens\n\n", array(
'%filename' => $file,
'%lineno' => $line,
'%marker' => $marker,
'%tokens' => $tokens,
)), 'error');
}