Ignore:
Timestamp:
Apr 28, 2006, 12:34:03 AM (18 years ago)
Author:
bcornec
Message:

Integration of a big patch from rene-marc dolhen <rmd_at_mecreant.org> to support internationalization with gettext.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/mondoarchive/main.c

    r424 r497  
    251251    char *say_at_end;
    252252
     253#ifdef ENABLE_NLS
     254    setlocale(LC_ALL, "");
     255    (void) textdomain("mondo");
     256#endif
    253257/* Make sure I'm root; abort if not */
    254258    if (getuid() != 0) {
    255         fprintf(stderr, "Please run as root.\r\n");
     259        fprintf(stderr, _("Please run as root.\n"));
    256260        exit(127);
    257261    }
     
    261265        && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V")
    262266            || !strcmp(argv[argc - 1], "--version"))) {
    263         printf("mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION);
     267        printf(_("mondoarchive v%s\nSee man page for help\n"), PACKAGE_VERSION);
    264268        exit(0);
    265269    }
     
    275279    diffs = 0;
    276280    say_at_end[0] = '\0';
    277     printf("Initializing...\n");
     281    printf(_("Initializing...\n"));
    278282    if (!(bkpinfo = malloc(sizeof(struct s_bkpinfo)))) {
    279283        fatal_error("Cannot malloc bkpinfo");
     
    321325        setup_newt_stuff();
    322326        if (!strstr(argv[2], "filelist")) {
    323             printf("Sorry - filelist goes first\n");
     327            printf(_("Sorry - filelist goes first\n"));
    324328            finish(1);
    325329        } else {
     
    350354        setup_newt_stuff();
    351355        if (!strstr(argv[2], "filelist")) {
    352             printf("Sorry - filelist goes first\n");
     356            printf(_("Sorry - filelist goes first\n"));
    353357            finish(1);
    354358        } else {
     
    370374        setup_newt_stuff();
    371375        if (find_cdrw_device(tmp)) {
    372             printf("Failed to find CDR-RW drive\n");
    373         } else {
    374             printf("CD-RW is at %s\n", tmp);
     376            printf(_("Failed to find CDR-RW drive\n"));
     377        } else {
     378            printf(_("CD-RW is at %s\n"), tmp);
    375379        }
    376380        tmp[0] = '\0';
    377381        if (find_cdrom_device(tmp, atoi(argv[2]))) {
    378             printf("Failed to find CD-ROM drive\n");
    379         } else {
    380             printf("CD-ROM is at %s\n", tmp);
     382            printf(_("Failed to find CD-ROM drive\n"));
     383        } else {
     384            printf(_("CD-ROM is at %s\n"), tmp);
    381385        }
    382386        finish(0);
     
    388392        setup_newt_stuff();
    389393        if (find_dvd_device(tmp, atoi(argv[2]))) {
    390             printf("Failed to find DVD drive\n");
    391         } else {
    392             printf("DVD is at %s\n", tmp);
     394            printf(_("Failed to find DVD drive\n"));
     395        } else {
     396            printf(_("DVD is at %s\n"), tmp);
    393397        }
    394398        finish(0);
     
    401405    if (argc > 2 && !strcmp(argv[1], "test-dev")) {
    402406        if (is_dev_an_NTFS_dev(argv[2])) {
    403             printf("%s is indeed an NTFS dev\n", argv[2]);
    404         } else {
    405             printf("%s is _not_ an NTFS dev\n", argv[2]);
     407            printf(_("%s is indeed an NTFS dev\n"), argv[2]);
     408        } else {
     409            printf(_("%s is _not_ an NTFS dev\n"), argv[2]);
    406410        }
    407411        finish(0);
     
    426430        if (res) {
    427431            printf
    428                 ("Errors were detected in the command line you supplied.\n");
    429             printf("Please review the log file - " MONDO_LOGFILE "\n");
     432                (_("Errors were detected in the command line you supplied.\n"));
     433            printf(_("Please review the log file - %s \n"),MONDO_LOGFILE);
    430434            log_msg(1, "Mondoarchive will now exit.");
    431435            finish(1);
     
    441445
    442446    log_to_screen
    443         ("BusyBox's sources are available from http://www.busybox.net");
     447        (_("BusyBox's sources are available from http://www.busybox.net"));
    444448    sprintf(g_erase_tmpdir_and_scratchdir, "rm -Rf %s %s", bkpinfo->tmpdir,
    445449            bkpinfo->scratchdir);
     
    457461        if (res) {
    458462            strcat(say_at_end,
    459                    "Data archived. Please check the logs, just as a precaution. ");
    460         } else {
    461             strcat(say_at_end, "Data archived OK. ");
     463                   _("Data archived. Please check the logs, just as a precaution. "));
     464        } else {
     465            strcat(say_at_end, _("Data archived OK. "));
    462466        }
    463467    }
     
    467471        res = verify_data(bkpinfo);
    468472        if (res < 0) {
    469             sprintf(tmp, "%d difference%c found.", -res,
     473            sprintf(tmp, _("%d difference%c found."), -res,
    470474                    (-res != 1) ? 's' : ' ');
    471475            strcat(say_at_end, tmp);
     
    487491    if (!retval) {
    488492        mvaddstr_and_log_it(g_currentY++, 0,
    489                             "Backup and/or verify ran to completion. Everything appears to be fine.");
     493                            _("Backup and/or verify ran to completion. Everything appears to be fine."));
    490494    } else {
    491495        mvaddstr_and_log_it(g_currentY++, 0,
    492                             "Backup and/or verify ran to completion. However, errors did occur.");
     496                            _("Backup and/or verify ran to completion. However, errors did occur."));
    493497    }
    494498
    495499    if (does_file_exist("/root/images/mindi/mondorescue.iso")) {
    496500        log_to_screen
    497             ("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it.");
     501            (_("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it."));
    498502    }
    499503
     
    502506        if (g_text_mode) {
    503507            log_to_screen
    504                 ("Type 'less /tmp/changed.files' to see which files don't match the archives");
     508                (_("Type 'less /tmp/changed.files' to see which files don't match the archives"));
    505509        } else {
    506510            log_msg(1,
    507                     "Type 'less /tmp/changed.files' to see which files don't match the archives");
     511                    _("Type 'less /tmp/changed.files' to see which files don't match the archives"));
    508512            log_msg(2, "Calling popup_changelist_from_file()");
    509513            popup_changelist_from_file("/tmp/changed.files");
     
    523527    system("rm -Rf /tmp.mondo.* /mondo.scratch.*");
    524528    if (!retval) {
    525         printf("Mondoarchive ran OK.\n");
     529        printf(_("Mondoarchive ran OK.\n"));
    526530    } else {
    527         printf("Errors occurred during backup. Please check logfile.\n");
     531        printf(_("Errors occurred during backup. Please check logfile.\n"));
    528532    }
    529533    distro_specific_kludges_at_end_of_mondoarchive();
     
    549553    if (!g_text_mode) {
    550554        popup_and_OK
    551             ("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt.");
    552         log_to_screen("See %s for details of backup run.", MONDO_LOGFILE);
     555            (_("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt."));
     556        log_to_screen(_("See %s for details of backup run."), MONDO_LOGFILE);
    553557        finish(retval);
    554558    } else {
    555         printf("See %s for details of backup run.\n", MONDO_LOGFILE);
     559        printf(_("See %s for details of backup run.\n"), MONDO_LOGFILE);
    556560        exit(retval);
    557561    }
Note: See TracChangeset for help on using the changeset viewer.