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/common/libmondo-devices.c

    r305 r497  
    352352            && !does_file_exist("/tmp/mountlist.txt.sample")) {
    353353            log_to_screen
    354                 ("Using /dev/root is stupid of you but I'll forgive you.");
     354                (_("Using /dev/root is stupid of you but I'll forgive you."));
    355355            is_this_a_ramdisk = FALSE;
    356356        }
     
    380380    switch (bt) {
    381381    case none:
    382         strcpy(output, "none");
     382        strcpy(output, _("none"));
    383383        break;
    384384    case iso:
    385         strcpy(output, "iso");
     385        strcpy(output, _("iso"));
    386386        break;
    387387    case cdr:
    388         strcpy(output, "cdr");
     388        strcpy(output, _("cdr"));
    389389        break;
    390390    case cdrw:
    391         strcpy(output, "cdrw");
     391        strcpy(output, _("cdrw"));
    392392        break;
    393393    case cdstream:
    394         strcpy(output, "cdstream");
     394        strcpy(output, _("cdstream"));
    395395        break;
    396396    case nfs:
    397         strcpy(output, "nfs");
     397        strcpy(output, _("nfs"));
    398398        break;
    399399    case tape:
    400         strcpy(output, "tape");
     400        strcpy(output, _("tape"));
    401401        break;
    402402    case udev:
    403         strcpy(output, "udev");
     403        strcpy(output, _("udev"));
    404404        break;
    405405    default:
    406         strcpy(output, "default");
     406        strcpy(output, _("default"));
    407407    }
    408408    return (output);
     
    695695    if (!dev[0] || (res = mount_CDROM_here(dev, mountpoint))) {
    696696        if (!popup_and_get_string
    697             ("CD-ROM device", "Please enter your CD-ROM's /dev device",
     697            (_("CD-ROM device"), _("Please enter your CD-ROM's /dev device"),
    698698             dev, MAX_STR_LEN / 4)) {
    699699            res = 1;
     
    703703    }
    704704    if (res) {
    705         log_msg(1, "mount failed");
     705        log_msg(1, _("mount failed"));
    706706    } else {
    707         log_msg(1, "mount succeeded with %s", dev);
     707        log_msg(1, _("mount succeeded with %s"), dev);
    708708    }
    709709    paranoid_free(dev);
     
    17721772            }
    17731773            if (res) {
    1774                 log_to_screen("WARNING - failed to unmount CD-ROM drive");
     1774                log_to_screen(_("WARNING - failed to unmount CD-ROM drive"));
    17751775            }
    17761776            if (!bkpinfo->please_dont_eject) {
     
    17801780            }
    17811781            if (res) {
    1782                 log_to_screen("WARNING - failed to eject CD-ROM disk");
     1782                log_to_screen(_("WARNING - failed to eject CD-ROM disk"));
    17831783            }
    17841784            popup_and_OK(request);
     
    18411841        which_backup_media_type(bkpinfo->restore_data);
    18421842    if (bkpinfo->backup_media_type == none) {
    1843         log_to_screen("User has chosen not to backup the PC");
     1843        log_to_screen(_("User has chosen not to backup the PC"));
    18441844        finish(1);
    18451845    }
    18461846    if (bkpinfo->backup_media_type == tape && bkpinfo->restore_data) {
    1847         popup_and_OK("Please remove CD/floppy from drive(s)");
     1847        popup_and_OK(_("Please remove CD/floppy from drive(s)"));
    18481848    }
    18491849    log_msg(3, "media type = %s",
     
    18801880        if (archiving_to_media) {
    18811881            if (ask_me_yes_or_no
    1882                 ("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?"))
     1882                (_("Is your computer a laptop, or does the CD writer incorporate BurnProof technology?")))
    18831883            {
    18841884                bkpinfo->manual_cd_tray = TRUE;
     
    18861886            if ((bkpinfo->compression_level =
    18871887                 which_compression_level()) == -1) {
    1888                 log_to_screen("User has chosen not to backup the PC");
     1888                log_to_screen(_("User has chosen not to backup the PC"));
    18891889                finish(1);
    18901890            }
    1891             sprintf(comment, "What speed is your %s (re)writer?",
     1891            sprintf(comment, _("What speed is your %s (re)writer?"),
    18921892                    media_descriptor_string(bkpinfo->backup_media_type));
    18931893            if (bkpinfo->backup_media_type == dvd) {
     
    19031903            }
    19041904            if (bkpinfo->backup_media_type != dvd) {
    1905                 if (!popup_and_get_string("Speed", comment, tmp, 4)) {
    1906                     log_to_screen("User has chosen not to backup the PC");
     1905                if (!popup_and_get_string(_("Speed"), comment, tmp, 4)) {
     1906                    log_to_screen(_("User has chosen not to backup the PC"));
    19071907                    finish(1);
    19081908                }
     
    19101910            bkpinfo->cdrw_speed = atoi(tmp);    // if DVD then this shouldn't ever be used anyway :)
    19111911            sprintf(comment,
    1912                     "How much data (in Megabytes) will each %s store?",
     1912                    _("How much data (in Megabytes) will each %s store?"),
    19131913                    media_descriptor_string(bkpinfo->backup_media_type));
    19141914            if (!popup_and_get_string("Size", comment, sz_size, 5)) {
    1915                 log_to_screen("User has chosen not to backup the PC");
     1915                log_to_screen(_("User has chosen not to backup the PC"));
    19161916                finish(1);
    19171917            }
     
    19201920            }
    19211921            if (bkpinfo->media_size[0] <= 0) {
    1922                 log_to_screen("User has chosen not to backup the PC");
     1922                log_to_screen(_("User has chosen not to backup the PC"));
    19231923                finish(1);
    19241924            }
     
    19411941                        bkpinfo->media_device);
    19421942                sprintf(comment,
    1943                         "Please specify your %s drive's /dev entry",
     1943                        _("Please specify your %s drive's /dev entry"),
    19441944                        media_descriptor_string(bkpinfo->
    19451945                                                backup_media_type));
    19461946                if (!popup_and_get_string
    1947                     ("Device?", comment, bkpinfo->media_device,
     1947                    (_("Device?"), comment, bkpinfo->media_device,
    19481948                     MAX_STR_LEN / 4)) {
    1949                     log_to_screen("User has chosen not to backup the PC");
     1949                    log_to_screen(_("User has chosen not to backup the PC"));
    19501950                    finish(1);
    19511951                }
     
    19601960            if (bkpinfo->media_device[0]) {
    19611961                sprintf(tmp,
    1962                         "I think I've found your %s burner at SCSI node %s; am I right on the money?",
     1962                        _("I think I've found your %s burner at SCSI node %s; am I right on the money?"),
    19631963                        media_descriptor_string(bkpinfo->
    19641964                                                backup_media_type),
     
    19701970            if (!bkpinfo->media_device[0]) {
    19711971                if (g_kernel_version < 2.6) {
    1972                     i = popup_and_get_string("Device node?",
    1973                                              "What is the SCSI node of your CD (re)writer, please?",
     1972                    i = popup_and_get_string(_("Device node?"),
     1973                                             _("What is the SCSI node of your CD (re)writer, please?"),
    19741974                                             bkpinfo->media_device,
    19751975                                             MAX_STR_LEN / 4);
    19761976                } else {
    1977                     i = popup_and_get_string("/dev entry?",
    1978                                              "What is the /dev entry of your CD (re)writer, please?",
     1977                    i = popup_and_get_string(_("/dev entry?"),
     1978                                             _("What is the /dev entry of your CD (re)writer, please?"),
    19791979                                             bkpinfo->media_device,
    19801980                                             MAX_STR_LEN / 4);
    19811981                }
    19821982                if (!i) {
    1983                     log_to_screen("User has chosen not to backup the PC");
     1983                    log_to_screen(_("User has chosen not to backup the PC"));
    19841984                    finish(1);
    19851985                }
     
    19941994    case udev:
    19951995        if (!ask_me_yes_or_no
    1996             ("This option is for advanced users only. Are you sure?")) {
    1997             log_to_screen("User has chosen not to backup the PC");
     1996            (_("This option is for advanced users only. Are you sure?"))) {
     1997            log_to_screen(_("User has chosen not to backup the PC"));
    19981998            finish(1);
    19991999        }
     
    20012001
    20022002        if (find_tape_device_and_size(bkpinfo->media_device, sz_size)) {
    2003             log_msg(3, "Ok, using vanilla scsi tape.");
     2003            log_msg(3, _("Ok, using vanilla scsi tape."));
    20042004            strcpy(bkpinfo->media_device, VANILLA_SCSI_TAPE);
    20052005            if ((fin = fopen(bkpinfo->media_device, "r"))) {
     
    20192019            }
    20202020            sprintf(tmp,
    2021                     "I think I've found your tape streamer at %s; am I right on the money?",
     2021                    _("I think I've found your tape streamer at %s; am I right on the money?"),
    20222022                    bkpinfo->media_device);
    20232023        }
    20242024        if (bkpinfo->media_device[0]) {
    20252025            sprintf(tmp,
    2026                     "I think I've found your tape streamer at %s; am I right on the money?",
     2026                    _("I think I've found your tape streamer at %s; am I right on the money?"),
    20272027                    bkpinfo->media_device);
    20282028            if (!ask_me_yes_or_no(tmp)) {
     
    20322032        if (!bkpinfo->media_device[0]) {
    20332033            if (!popup_and_get_string
    2034                 ("Device name?",
    2035                  "What is the /dev entry of your tape streamer?",
     2034                (_("Device name?"),
     2035                 _("What is the /dev entry of your tape streamer?"),
    20362036                 bkpinfo->media_device, MAX_STR_LEN / 4)) {
    2037                 log_to_screen("User has chosen not to backup the PC");
     2037                log_to_screen(_("User has chosen not to backup the PC"));
    20382038                finish(1);
    20392039            }
     
    20412041        sprintf(tmp, "ls -l %s", bkpinfo->media_device);
    20422042        if (run_program_and_log_output(tmp, FALSE)) {
    2043             log_to_screen("User has not specified a valid /dev entry");
     2043            log_to_screen(_("User has not specified a valid /dev entry"));
    20442044            finish(1);
    20452045        }
     
    20692069            if ((bkpinfo->compression_level =
    20702070                 which_compression_level()) == -1) {
    2071                 log_to_screen("User has chosen not to backup the PC");
     2071                log_to_screen(_("User has chosen not to backup the PC"));
    20722072                finish(1);
    20732073            }
     
    20902090        {
    20912091            if (!popup_and_get_string
    2092                 ("NFS dir.",
    2093                  "Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)",
     2092                (_("NFS dir."),
     2093                 _("Please enter path and directory where archives are stored remotely. (Mondo has taken a guess at the correct value. If it is incorrect, delete it and type the correct one.)"),
    20942094                 bkpinfo->nfs_mount, MAX_STR_LEN / 4)) {
    2095                 log_to_screen("User has chosen not to backup the PC");
     2095                log_to_screen(_("User has chosen not to backup the PC"));
    20962096                finish(1);
    20972097            }
     
    20992099                if ((bkpinfo->compression_level =
    21002100                     which_compression_level()) == -1) {
    2101                     log_to_screen("User has chosen not to backup the PC");
     2101                    log_to_screen(_("User has chosen not to backup the PC"));
    21022102                    finish(1);
    21032103                }
     
    21142114
    21152115            sprintf(comment,
    2116                     "How much data (in Megabytes) will each media store?");
    2117             if (!popup_and_get_string("Size", comment, sz_size, 5)) {
    2118                 log_to_screen("User has chosen not to backup the PC");
     2116                    _("How much data (in Megabytes) will each media store?"));
     2117            if (!popup_and_get_string(_("Size"), comment, sz_size, 5)) {
     2118                log_to_screen(_("User has chosen not to backup the PC"));
    21192119                finish(1);
    21202120            }
     
    21232123            }
    21242124            if (bkpinfo->media_size[0] <= 0) {
    2125                 log_to_screen("User has chosen not to backup the PC");
     2125                log_to_screen(_("User has chosen not to backup the PC"));
    21262126                finish(1);
    21272127            }
     
    21302130            system("umount /tmp/isodir 2> /dev/null");
    21312131            if (!popup_and_get_string
    2132                 ("NFS share", "Which remote NFS share should I mount?",
     2132                (_("NFS share"), _("Which remote NFS share should I mount?"),
    21332133                 bkpinfo->nfs_mount, MAX_STR_LEN)) {
    2134                 log_to_screen("User has chosen not to backup the PC");
     2134                log_to_screen(_("User has chosen not to backup the PC"));
    21352135                finish(1);
    21362136            }
     
    21492149        if (!is_this_device_mounted(bkpinfo->nfs_mount)) {
    21502150            popup_and_OK
    2151                 ("Please mount that partition before you try to backup to or restore from it.");
     2151                (_("Please mount that partition before you try to backup to or restore from it."));
    21522152            finish(1);
    21532153        }
    21542154        strcpy(tmp, bkpinfo->nfs_remote_dir);
    21552155        if (!popup_and_get_string
    2156             ("Directory", "Which directory within that mountpoint?", tmp,
     2156            (_("Directory"), _("Which directory within that mountpoint?"), tmp,
    21572157             MAX_STR_LEN)) {
    2158             log_to_screen("User has chosen not to backup the PC");
     2158            log_to_screen(_("User has chosen not to backup the PC"));
    21592159            finish(1);
    21602160        }
     
    21672167            strcpy(tmp, bkpinfo->nfs_remote_dir);
    21682168            sprintf(prompt,
    2169                     "Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup.",
     2169                    _("Directory '%s' under mountpoint '%s' does not exist or is not writable. You can fix this or change the directory and retry or cancel the backup."),
    21702170                    bkpinfo->nfs_remote_dir, bkpinfo->isodir);
    21712171            if (!popup_and_get_string
    2172                 ("Directory", prompt, tmp, MAX_STR_LEN)) {
    2173                 log_to_screen("User has chosen not to backup the PC");
     2172                (_("Directory"), prompt, tmp, MAX_STR_LEN)) {
     2173                log_to_screen(_("User has chosen not to backup the PC"));
    21742174                finish(1);
    21752175            }
     
    21812181        }
    21822182        if (!popup_and_get_string
    2183             ("Prefix.",
    2184              "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files",
     2183            (_("Prefix."),
     2184             _("Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files"),
    21852185            bkpinfo->prefix, MAX_STR_LEN / 4)) {
    2186             log_to_screen("User has chosen not to backup the PC");
     2186            log_to_screen(_("User has chosen not to backup the PC"));
    21872187            finish(1);
    21882188        }
     
    22002200        if (!bkpinfo->disaster_recovery) {
    22012201            if (!popup_and_get_string
    2202                 ("Storage dir.",
    2203                  "Please enter the full path that contains your ISO images.  Example: /mnt/raid0_0",
     2202                (_("Storage dir."),
     2203                 _("Please enter the full path that contains your ISO images.  Example: /mnt/raid0_0"),
    22042204                 bkpinfo->isodir, MAX_STR_LEN / 4)) {
    2205                 log_to_screen("User has chosen not to backup the PC");
     2205                log_to_screen(_("User has chosen not to backup the PC"));
    22062206                finish(1);
    22072207            }
     
    22092209                if ((bkpinfo->compression_level =
    22102210                     which_compression_level()) == -1) {
    2211                     log_to_screen("User has chosen not to backup the PC");
     2211                    log_to_screen(_("User has chosen not to backup the PC"));
    22122212                    finish(1);
    22132213                }
    22142214                if (!popup_and_get_string
    2215                     ("ISO size.",
    2216                      "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s or DVD's you plan to backup to.",
     2215                    (_("ISO size."),
     2216                     _("Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s or DVD's you plan to backup to."),
    22172217                     sz_size, 16)) {
    2218                     log_to_screen("User has chosen not to backup the PC");
     2218                    log_to_screen(_("User has chosen not to backup the PC"));
    22192219                    finish(1);
    22202220                }
     
    22232223                }
    22242224                if (!popup_and_get_string
    2225                     ("Prefix.",
    2226                      "Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files",
     2225                    (_("Prefix."),
     2226                     _("Please enter the prefix that will be prepended to your ISO filename.  Example: machine1 to obtain machine1-[1-9]*.iso files"),
    22272227                     bkpinfo->prefix, MAX_STR_LEN / 4)) {
    22282228                    log_to_screen("User has chosen not to backup the PC");
     
    22592259#ifdef __FreeBSD__
    22602260            if (!popup_and_get_string
    2261                 ("Boot device",
    2262                  "What is your boot device? (e.g. /dev/ad0)",
     2261                (_("Boot device"),
     2262                 _("What is your boot device? (e.g. /dev/ad0)"),
    22632263                 bkpinfo->boot_device, MAX_STR_LEN / 4)) {
    2264                 log_to_screen("User has chosen not to backup the PC");
     2264                log_to_screen(_("User has chosen not to backup the PC"));
    22652265                finish(1);
    22662266            }
     
    22682268#else
    22692269            if (!popup_and_get_string
    2270                 ("Boot device",
    2271                  "What is your boot device? (e.g. /dev/hda)",
     2270                (_("Boot device"),
     2271                 _("What is your boot device? (e.g. /dev/hda)"),
    22722272                 bkpinfo->boot_device, MAX_STR_LEN / 4)) {
    2273                 log_to_screen("User has chosen not to backup the PC");
     2273                log_to_screen(_("User has chosen not to backup the PC"));
    22742274                finish(1);
    22752275            }
     
    22912291            if (i == 'U') {
    22922292                if (ask_me_yes_or_no
    2293                     ("Unidentified boot loader. Shall I restore it byte-for-byte at restore time and hope for the best?"))
     2293                    (_("Unidentified boot loader. Shall I restore it byte-for-byte at restore time and hope for the best?")))
    22942294                {
    22952295                    i = 'R';    // raw
    22962296                } else {
    22972297                    log_to_screen
    2298                         ("I cannot find your boot loader. Please run mondoarchive with parameters.");
     2298                        (_("I cannot find your boot loader. Please run mondoarchive with parameters."));
    22992299                    finish(1);
    23002300                }
     
    23042304        strcpy(bkpinfo->include_paths, "/");
    23052305        if (!popup_and_get_string
    2306             ("Backup paths",
    2307              "Please enter paths which you want me to backup. The default is '/' (i.e. everything).",
     2306            (_("Backup paths"),
     2307             _("Please enter paths which you want me to backup. The default is '/' (i.e. everything)."),
    23082308             bkpinfo->include_paths, MAX_STR_LEN)) {
    2309             log_to_screen("User has chosen not to backup the PC");
     2309            log_to_screen(_("User has chosen not to backup the PC"));
    23102310            finish(1);
    23112311        }
     
    23232323        if (strlen(tmp) > 2) {
    23242324            if (!popup_and_get_string
    2325                 ("NTFS partitions",
    2326                  "Please enter/confirm the NTFS partitions you wish to backup as well.",
     2325                (_("NTFS partitions"),
     2326                 _("Please enter/confirm the NTFS partitions you wish to backup as well."),
    23272327                 tmp, MAX_STR_LEN / 4)) {
    2328                 log_to_screen("User has chosen not to backup the PC");
     2328                log_to_screen(_("User has chosen not to backup the PC"));
    23292329                finish(1);
    23302330            }
     
    23342334
    23352335        if (!popup_and_get_string
    2336             ("Exclude paths",
    2337              "Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup.",
     2336            (_("Exclude paths"),
     2337             _("Please enter paths which you do NOT want to backup. Separate them with spaces. NB: /tmp and /proc are always excluded. :-) Just hit 'Enter' if you want to do a full system backup."),
    23382338             bkpinfo->exclude_paths, MAX_STR_LEN)) {
    2339             log_to_screen("User has chosen not to backup the PC");
     2339            log_to_screen(_("User has chosen not to backup the PC"));
    23402340            finish(1);
    23412341        }
     
    23442344        bkpinfo->verify_data =
    23452345            ask_me_yes_or_no
    2346             ("Will you want to verify your backups after Mondo has created them?");
     2346            (_("Will you want to verify your backups after Mondo has created them?"));
    23472347
    23482348#ifndef __FreeBSD__
    23492349        if (!ask_me_yes_or_no
    2350             ("Are you confident that your kernel is a sane, sensible, standard Linux kernel? Say 'no' if you are using a Gentoo <1.4 or Debian <3.0, please."))
     2350            (_("Are you confident that your kernel is a sane, sensible, standard Linux kernel? Say 'no' if you are using a Gentoo <1.4 or Debian <3.0, please.")))
    23512351#endif
    23522352        {
     
    23552355
    23562356        if (!ask_me_yes_or_no
    2357             ("Are you sure you want to proceed? Hit 'no' to abort.")) {
    2358             log_to_screen("User has chosen not to backup the PC");
     2357            (_("Are you sure you want to proceed? Hit 'no' to abort."))) {
     2358            log_to_screen(_("User has chosen not to backup the PC"));
    23592359            finish(1);
    23602360        }
Note: See TracChangeset for help on using the changeset viewer.