You are here

function _potx_parse_shipped_configuration in Translation template extractor 6.3

Same name and namespace in other branches
  1. 8 potx.inc \_potx_parse_shipped_configuration()
  2. 7.3 potx.inc \_potx_parse_shipped_configuration()
  3. 7.2 potx.inc \_potx_parse_shipped_configuration()

Parse shipped configuration for translatables. Drupal 8+

Parameters

string $save_callback:

string $api_version:

2 calls to _potx_parse_shipped_configuration()
PotxTestCase::testDrupal8ShippedConfiguration in tests/potx.test
Test parsing of Drupal 8 shipped configuration files.
potx_finish_processing in ./potx.inc
Executes tasks that need to happen after all the files have been processed.

File

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

Code

function _potx_parse_shipped_configuration($save_callback = '_potx_save_string', $api_version = POTX_API_CURRENT) {
  global $_potx_config_set;
  if (!is_array($_potx_config_set)) {
    return;
  }
  foreach ($_potx_config_set as $config_path) {

    // Find the schema that matches the config file.
    $path_info = pathinfo($config_path);
    $config_name = $path_info['filename'];
    $schema = _potx_find_matching_schema($config_name);
    if ($schema == '') {

      // No schema was found matching this config.
      continue;
    }
    $config_code = file_get_contents($config_path);
    $parsed_config = Yaml::parse($config_code);
    unset($config_code);
    _potx_find_shipped_config_translatables($parsed_config, $schema, NULL, NULL, $config_path, $save_callback);
  }
}