You are here

function _potx_add_default_region_names in Translation template extractor 8

Same name and namespace in other branches
  1. 5.2 potx.inc \_potx_add_default_region_names()
  2. 5 potx.inc \_potx_add_default_region_names()
  3. 6.3 potx.inc \_potx_add_default_region_names()
  4. 6 potx.inc \_potx_add_default_region_names()
  5. 6.2 potx.inc \_potx_add_default_region_names()
  6. 7.3 potx.inc \_potx_add_default_region_names()
  7. 7 potx.inc \_potx_add_default_region_names()
  8. 7.2 potx.inc \_potx_add_default_region_names()

Add default theme region names, which cannot be extracted otherwise.

These default names are defined in system.module.

Parameters

string $file: Name of the file parsed.

string $save_callback: Callback function used to save strings.

int $api_version: Drupal API version to work with.

1 call to _potx_add_default_region_names()
_potx_parse_php_file in ./potx.inc
Parse a PHP file for translatables.

File

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

Code

function _potx_add_default_region_names($file, $save_callback, $api_version = POTX_API_CURRENT) {
  $regions = [
    'left' => 'Left sidebar',
    'right' => 'Right sidebar',
    'content' => 'Content',
    'header' => 'Header',
    'footer' => 'Footer',
  ];
  if ($api_version > POTX_API_6) {
    $regions['highlight'] = 'Highlighted';
    $regions['help'] = 'Help';
    $regions['page_top'] = 'Page top';
    $regions['page_top'] = 'Page bottom';
  }
  foreach ($regions as $region) {

    // Regions come with the default context.
    $save_callback($region, POTX_CONTEXT_NONE, $file);
  }
}