You are here

function configuration_translatables_export in Configuration Management 7

Helper function to return an array of t()'d translatables strings. Useful for providing a separate array of translatables with your export so that string extractors like potx can detect them.

3 calls to configuration_translatables_export()
field_configuration_export_render in includes/configuration.field.inc
Implements hook_configuration_export_render().
menu_custom_configuration_export_render in includes/configuration.menu.inc
Implements hook_configuration_export_render()
menu_links_configuration_export_render in includes/configuration.menu.inc
Implements hook_configuration_export_render()

File

./configuration.export.inc, line 397

Code

function configuration_translatables_export($translatables, $indent = '') {
  $output = '';
  $translatables = array_filter(array_unique($translatables));
  if (!empty($translatables)) {
    $output .= "{$indent}// Translatables\n";
    $output .= "{$indent}// Included for use with string extractors like potx.\n";
    sort($translatables);
    foreach ($translatables as $string) {
      $output .= "{$indent}t(" . configuration_var_export($string) . ");\n";
    }
  }
  return $output;
}