You are here

function stringoverrides_migrate_admin_export_text in String Overrides 7

Returns the exported *.po text from the given language.

File

./stringoverrides_migrate.admin.inc, line 107
Stringoverride migration admin.

Code

function stringoverrides_migrate_admin_export_text($lang = 'en') {
  $languages = language_list();
  $custom_strings = variable_get("locale_custom_strings_{$lang}", array());
  foreach ($custom_strings as $context => $translations) {
    foreach ($translations as $source => $translation) {
      $strings[] = array(
        'context' => $context,
        'source' => $source,
        'translation' => $translation,
        'comment' => '',
      );
    }
  }
  return _locale_export_po_generate($languages[$lang], $strings);
}