Changeset 507 in MondoRescue for trunk/mondo/mondo/mondoarchive/main.c


Ignore:
Timestamp:
Apr 30, 2006, 2:04:16 AM (18 years ago)
Author:
bcornec
Message:

merge -r489:506 $SVN_M/branches/stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondoarchive/main.c

    r426 r507  
    138138    char *say_at_end = NULL;
    139139
     140#ifdef ENABLE_NLS
     141    setlocale(LC_ALL, "");
     142    (void) textdomain("mondo");
     143#endif
    140144/* Make sure I'm root; abort if not */
    141145    if (getuid() != 0) {
    142         fprintf(stderr, "Please run as root.\r\n");
     146        fprintf(stderr, _("Please run as root.\n"));
    143147        exit(127);
    144148    }
     
    148152        && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V")
    149153            || !strcmp(argv[argc - 1], "--version"))) {
    150         printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION);
     154        printf(_("mondoarchive v%s\nSee man page for help\n"), PACKAGE_VERSION);
    151155        exit(0);
    152156    }
     
    157161
    158162    diffs = 0;
    159     printf("Initializing...\n");
     163    printf(_("Initializing...\n"));
    160164    if (!(bkpinfo = malloc(sizeof(struct s_bkpinfo)))) {
    161165        fatal_error("Cannot malloc bkpinfo");
     
    197201        setup_newt_stuff();
    198202        if (!strstr(argv[2], "filelist")) {
    199             printf("Sorry - filelist goes first\n");
     203            printf(_("Sorry - filelist goes first\n"));
    200204            finish(1);
    201205        } else {
     
    226230        setup_newt_stuff();
    227231        if (!strstr(argv[2], "filelist")) {
    228             printf("Sorry - filelist goes first\n");
     232            printf(_("Sorry - filelist goes first\n"));
    229233            finish(1);
    230234        } else {
     
    245249        setup_newt_stuff();
    246250        if ((tmp = find_cdrw_device()) == NULL) {
    247             printf("Failed to find CDR-RW drive\n");
    248         } else {
    249             printf("CD-RW is at %s\n", tmp);
     251            printf(_("Failed to find CDR-RW drive\n"));
     252        } else {
     253            printf(_("CD-RW is at %s\n"), tmp);
    250254        }
    251255        paranoid_free(tmp);
    252256
    253257        if ((tmp = find_cdrom_device(FALSE)) == NULL) {
    254             printf("Failed to find CD-ROM drive\n");
    255         } else {
    256             printf("CD-ROM is at %s\n", tmp);
     258            printf(_("Failed to find CD-ROM drive\n"));
     259        } else {
     260            printf(_("CD-ROM is at %s\n"), tmp);
    257261        }
    258262        paranoid_free(tmp);
     
    265269        setup_newt_stuff();
    266270        if ((tmp = find_dvd_device()) == NULL) {
    267             printf("Failed to find DVD drive\n");
    268         } else {
    269             printf("DVD is at %s\n", tmp);
     271            printf(_("Failed to find DVD drive\n"));
     272        } else {
     273            printf(_("DVD is at %s\n"), tmp);
    270274        }
    271275        paranoid_free(tmp);
     
    279283    if (argc > 2 && !strcmp(argv[1], "test-dev")) {
    280284        if (is_dev_an_NTFS_dev(argv[2])) {
    281             printf("%s is indeed an NTFS dev\n", argv[2]);
    282         } else {
    283             printf("%s is _not_ an NTFS dev\n", argv[2]);
     285            printf(_("%s is indeed an NTFS dev\n"), argv[2]);
     286        } else {
     287            printf(_("%s is _not_ an NTFS dev\n"), argv[2]);
    284288        }
    285289        finish(0);
     
    304308        if (res) {
    305309            printf
    306                 ("Errors were detected in the command line you supplied.\n");
    307             printf("Please review the log file - " MONDO_LOGFILE "\n");
     310                (_("Errors were detected in the command line you supplied.\n"));
     311            printf(_("Please review the log file - %s \n"),MONDO_LOGFILE);
    308312            log_msg(1, "Mondoarchive will now exit.");
    309313            finish(1);
     
    319323
    320324    log_to_screen
    321         ("BusyBox's sources are available from http://www.busybox.net");
     325        (_("BusyBox's sources are available from http://www.busybox.net"));
    322326
    323327    /* If we're meant to backup then backup */
     
    327331        if (res) {
    328332            asprintf(&say_at_end,
    329                    "Data archived. Please check the logs, just as a precaution. ");
    330         } else {
    331             asprintf(&say_at_end, "Data archived OK. ");
     333                   _("Data archived. Please check the logs, just as a precaution. "));
     334        } else {
     335            asprintf(&say_at_end, _("Data archived OK. "));
    332336        }
    333337    }
     
    337341        res = verify_data(bkpinfo);
    338342        if (res < 0) {
    339             asprintf(&say_at_end, "%d difference%c found.", -res,
     343            asprintf(&say_at_end, _("%d difference%c found."), -res,
    340344                    (-res != 1) ? 's' : ' ');
    341345            res = 0;
     
    353357    if (retval == 0) {
    354358        mvaddstr_and_log_it(g_currentY++, 0,
    355                             "Backup and/or verify ran to completion. Everything appears to be fine.");
     359                            _("Backup and/or verify ran to completion. Everything appears to be fine."));
    356360    } else {
    357361        mvaddstr_and_log_it(g_currentY++, 0,
    358                             "Backup and/or verify ran to completion. However, errors did occur.");
     362                            _("Backup and/or verify ran to completion. However, errors did occur."));
    359363    }
    360364
    361365    if (does_file_exist("/root/images/mindi/mondorescue.iso")) {
    362366        log_to_screen
    363             ("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it.");
     367            (_("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it."));
    364368    }
    365369
     
    368372        if (g_text_mode) {
    369373            log_to_screen
    370                 ("Type 'less /tmp/changed.files' to see which files don't match the archives");
     374                (_("Type 'less /tmp/changed.files' to see which files don't match the archives"));
    371375        } else {
    372376            log_msg(1,
    373                     "Type 'less /tmp/changed.files' to see which files don't match the archives");
     377                    _("Type 'less /tmp/changed.files' to see which files don't match the archives"));
    374378            log_msg(2, "Calling popup_changelist_from_file()");
    375379            popup_changelist_from_file("/tmp/changed.files");
     
    395399    system("rm -Rf /tmp.mondo.* /mondo.scratch.*");
    396400    if (retval == 0) {
    397         printf("Mondoarchive ran OK.\n");
     401        printf(_("Mondoarchive ran OK.\n"));
    398402    } else {
    399         printf("Errors occurred during backup. Please check logfile.\n");
     403        printf(_("Errors occurred during backup. Please check logfile.\n"));
    400404    }
    401405    distro_specific_kludges_at_end_of_mondoarchive();
     
    414418    if (!g_text_mode) {
    415419        popup_and_OK
    416             ("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt.");
    417         log_to_screen("See %s for details of backup run.", MONDO_LOGFILE);
     420            (_("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt."));
     421        log_to_screen(_("See %s for details of backup run."), MONDO_LOGFILE);
    418422        finish(retval);
    419423    } else {
    420         printf("See %s for details of backup run.\n", MONDO_LOGFILE);
     424        printf(_("See %s for details of backup run.\n"), MONDO_LOGFILE);
    421425        exit(retval);
    422426    }
Note: See TracChangeset for help on using the changeset viewer.