You are here

function features_translatables_export in Features 6

Same name and namespace in other branches
  1. 7.2 features.export.inc \features_translatables_export()
  2. 7 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.

4 calls to features_translatables_export()
content_features_export_render in includes/features.content.inc
Implementation of hook_features_export_render().
fieldgroup_features_export_render in includes/features.fieldgroup.inc
Implementation of hook_features_export_render().
menu_custom_features_export_render in includes/features.menu.inc
Implementation of hook_features_export_render()
menu_links_features_export_render in includes/features.menu.inc
Implementation of hook_features_export_render()

File

./features.export.inc, line 492

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;
}