You are here

function _potx_marker_error in Translation template extractor 6.2

Same name and namespace in other branches
  1. 8 potx.inc \_potx_marker_error()
  2. 5.2 potx.inc \_potx_marker_error()
  3. 5 potx.inc \_potx_marker_error()
  4. 6.3 potx.inc \_potx_marker_error()
  5. 6 potx.inc \_potx_marker_error()
  6. 7.3 potx.inc \_potx_marker_error()
  7. 7 potx.inc \_potx_marker_error()
  8. 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

$error: Helpful error message for users.

$docs_url: Documentation reference.

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 548
Extraction API used by the web and command line interface.

Code

function _potx_marker_error($file, $line, $marker, $ti, $error, $docs_url = NULL) {
  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('error', $error, $file, $line, $marker . '(' . $tokens, $docs_url);
}