You are here

constant POTX_JS_OBJECT_CONTEXT in Translation template extractor 7.3

Same name and namespace in other branches
  1. 8 potx.inc \POTX_JS_OBJECT_CONTEXT
  2. 6.3 potx.inc \POTX_JS_OBJECT_CONTEXT
  3. 7.2 potx.inc \POTX_JS_OBJECT_CONTEXT

Regular expression to match an object containing a key 'context'.

Pattern to match a JS object containing a 'context key' with a string value, which is captured. Will fail if there are nested objects.

1 use of POTX_JS_OBJECT_CONTEXT
_potx_parse_js_file in ./potx.inc
Parse a JavaScript file for translatables. Only from Drupal 6.

File

./potx.inc, line 154
Extraction API used by the web and command line interface.

Code

define('POTX_JS_OBJECT_CONTEXT', '
  \\{              # match object literal start
  .*?             # match anything, non-greedy
  (?:             # match a form of "context"
    \'context\'
    |
    "context"
    |
    context
  )
  \\s*:\\s*         # match key-value separator ":"
  (' . POTX_JS_STRING . ')  # match context string
  .*?             # match anything, non-greedy
  \\}              # match end of object literal
');