You are here

function language_features_export_render in Features 7

Same name and namespace in other branches
  1. 7.2 includes/features.locale.inc \language_features_export_render()

Implements hook_features_export_render().

File

includes/features.locale.inc, line 53
Features hooks for language.

Code

function language_features_export_render($module, $data, $export = NULL) {
  $code = array();
  $code[] = '  $languages = array();';
  $code[] = '';
  $language_list = language_list();
  foreach ($data as $name) {

    // Only render existing languages.
    if (!empty($language_list[$name])) {
      $var = (array) $language_list[$name];

      // Unset javascript hash
      unset($var['javascript']);
      $lang_export = features_var_export($var, '  ');
      $lang_identifier = features_var_export($name);
      $code[] = "  // Exported language: {$name}.";
      $code[] = "  \$languages[{$lang_identifier}] = {$lang_export};";
    }
  }
  $code[] = '  return $languages;';
  $code = implode("\n", $code);
  return array(
    'locale_default_languages' => $code,
  );
}