// Get PO file for that edit_locale: $AdminUI->append_to_titlearea(sprintf(T_('Extracting language file for %s...'), '<b>' . $edit_locale . '</b>')); $po_file = $locales_path . $locales[$edit_locale]['messages'] . '/LC_MESSAGES/messages.po'; if (!is_file($po_file)) { $Messages->add(sprintf(T_('File <code>%s</code> not found.'), '/' . $locales_subdir . $locales[$edit_locale]['messages'] . '/LC_MESSAGES/messages.po'), 'error'); break; } $outfile = $locales_path . $locales[$edit_locale]['messages'] . '/_global.php'; if (file_exists($outfile) && !is_writable($outfile)) { // The '_global.php' file exists but it is not writable $Messages->add(sprintf(T_('The file %s is not writable.'), '<b>' . $outfile . '</b>')); break; } load_class('locales/_pofile.class.php', 'POFile'); $POFile = new POFile($po_file); $POFile->read(true); // adds info about sources to $Messages $POFile->write_evo_trans($outfile, $locales[$edit_locale]['messages']); // Redirect so that a reload doesn't write to the DB twice: header_redirect('?ctrl=locales' . ($loc_transinfo ? '&loc_transinfo=1' : ''), 303); // Will EXIT // We have EXITed already at this point!! break; case 'resetlocale': // Reset a specific Locale: // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('locales'); // Check permission: $current_User->check_perm('options', 'edit', true); $edit_locale_messages = empty($locales[$edit_locale]['messages']) ? $edit_locale : str_replace('-', '_', $locales[$edit_locale]['messages']); $edit_locale_path = $locales_path . $edit_locale_messages . '/' . $edit_locale . '.locale.php';