$avail_locales[basename($avail_locale, '.po')] = $avail_locale;
 }
 $pot_file = $template_dir . $lp_module . '.pot';
 if (!is_readable($pot_file)) {
     I2CE::raiseError($pot_file . " is not readable for {$module}");
     continue;
 }
 $old_translations = loadPOT($pot_file);
 $sources = array_keys($old_translations);
 foreach ($sources as $i => $source) {
     if (strlen(trim($source)) == 0) {
         unset($sources[$i]);
         continue;
     }
 }
 $old_src = chooseMenuValue("Which string would you like to change?", $sources);
 do {
     $new_src = trim(ask("What is the new source?"));
 } while (!simple_prompt("Replace:\n\t{$old_src}\nto:\n\t{$new_src}"));
 if (simple_prompt("Would you like to preserve the existing translations in the .po files for the locales " . implode(",", array_keys($avail_locales)) . "?")) {
     foreach ($avail_locales as $avail_locale => $avail_locale_file) {
         I2CE::raiseError("Updateing {$lp_module}'s {$avail_locale}.po");
         $loc_translations = loadPot($avail_locale_file);
         $top_module = $found_modules[$module];
         $new_loc_translations = array();
         foreach ($loc_translations as $key => $vals) {
             if ($key == $old_src) {
                 $key = $new_src;
             }
             $new_loc_translations[$key] = $vals;
         }
Exemple #2
0
            break;
    }
}
if (!$launchpad_login) {
    $launchpad_login = trim(ask("What is the launchpad name/team to put packages under?"));
}
if ($keyid) {
    $keyid = '-k' . $keyid;
} else {
    $gpg_keys = explode("\n", trim(shell_exec("gpg --list-public-keys | grep ^pub | awk '{print \$2}' | awk -F / '{print \$2}'")));
    if (count($gpg_keys) == 0) {
        I2CE::raiseError("Nothing to to sign with.. you need gnupg\n");
        die;
    }
    if (count($gpg_keys) > 1) {
        $keyid = '-k' . chooseMenuValue("Choose a GPG Key", $gpg_keys);
    } else {
        $keyid = false;
    }
}
if ($rc) {
    $tmp_dir_base = "/home/" . trim($whoami) . "/ihris-{$rc}-ppa/{$launchpad_login}/{$ppa}";
} else {
    $tmp_dir_base = "/home/" . trim($whoami) . "/ihris-ppa/{$launchpad_login}/{$ppa}";
}
if ($booleans['prompt'] && !simple_prompt("use {$tmp_dir_base} to store release branches and debian packaging?")) {
    while (true) {
        $tmp_dir_base = ask("What directory should I use");
        if (is_dir($tmp_dir_base)) {
            break;
        } else {