You are here

function stringoverrides_admin_export in String Overrides 5

Same name and namespace in other branches
  1. 6 stringoverrides.admin.inc \stringoverrides_admin_export()

Ability to export a *.po file.

1 string reference to 'stringoverrides_admin_export'
stringoverrides_menu in ./stringoverrides.module
Implementation of hook_menu()

File

./stringoverrides.admin.inc, line 220
Admin page callbacks for the String Overrides module.

Code

function stringoverrides_admin_export() {
  $form = array();
  $export = '';
  $overrides = variable_get('locale_custom_strings_en', array());
  foreach ($overrides as $override => $string) {
    $export .= 'msgid "' . $override . "\"\nmsgstr \"{$string}\"\n";
  }
  $form['overrides'] = array(
    '#type' => 'textarea',
    '#title' => t('Export'),
    '#default_value' => $export,
    '#description' => t('This is the generated *.po file.'),
  );
  return $form;
}