You are here

function features_translatables_export in Features 7

Same name and namespace in other branches
  1. 6 features.export.inc \features_translatables_export()
  2. 7.2 features.export.inc \features_translatables_export()

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 features_translatables_export()
field_features_export_render in includes/features.field.inc
Implements hook_features_export_render().
menu_custom_features_export_render in includes/features.menu.inc
Implements hook_features_export_render()
menu_links_features_export_render in includes/features.menu.inc
Implements hook_features_export_render()

File

./features.export.inc, line 513

Code

function features_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(" . features_var_export($string) . ");\n";
    }
  }
  return $output;
}