You are here

function potx_local_init in Translation template extractor 8

Same name and namespace in other branches
  1. 7.3 potx.local.inc \potx_local_init()

Initialize potx to run locally, e.g. by drush.

Parameters

string $module_path: Path to the module that is being parsed by potx.

4 calls to potx_local_init()
PotxCommands::potx in src/Commands/PotxCommands.php
Extract translatable strings from Drupal source code.
PotxExtractTranslationForm::submitForm in src/Form/PotxExtractTranslationForm.php
Form submission handler.
PotxTest::setUp in tests/src/Kernel/PotxTest.php
potx_drush_extract in ./potx.drush.inc
Drush command callback.

File

./potx.local.inc, line 17
Hook implementations for this module.

Code

function potx_local_init($module_path = NULL) {
  global $_potx_found_modules;
  global $_potx_schema_lookup;
  global $_potx_reverse_lookup_built;
  $_potx_found_modules = [];
  $_potx_schema_lookup = [];
  $_potx_reverse_lookup_built = FALSE;
  global $_potx_callbacks;
  $_potx_callbacks = [
    'schema_store_lookup' => '_potx_schema_store_lookup',
    'schema_reverse_lookup' => '_potx_schema_reverse_lookup',
    'load_module_metadata' => '_potx_load_module_metadata',
    'store_module_metadata' => '_potx_store_module_metadata',
    'schema_store' => '_potx_schema_store',
    'schema_load' => '_potx_schema_load',
  ];
  if ($module_path !== NULL) {
    _potx_find_all_modules($module_path);
  }
}